Tests: add basic ctor tests

This commit is contained in:
Vlad Jerca 2019-03-03 01:33:00 +02:00
parent 1c8ab3b1da
commit 74ea8a42e0
6 changed files with 56 additions and 16 deletions

View file

@ -3,21 +3,18 @@
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFMpegCore.Tests namespace FFMpegCore.Test
{ {
[TestClass] [TestClass]
public class ArgumentBuilderTests : BaseTest public class ArgumentBuilderTest : BaseTest
{ {
List<string> concatFiles = new List<string> List<string> concatFiles = new List<string>
{ "1.mp4", "2.mp4", "3.mp4", "4.mp4"}; { "1.mp4", "2.mp4", "3.mp4", "4.mp4"};
FFArgumentBuilder builder; FFArgumentBuilder builder;
public ArgumentBuilderTests() : base() public ArgumentBuilderTest() : base()
{ {
builder = new FFArgumentBuilder(); builder = new FFArgumentBuilder();
} }

View file

@ -1,9 +1,9 @@
using FFMpegCore.Enums; using FFMpegCore.Enums;
using FFMpegCore.Tests.Resources; using FFMpegCore.Test.Resources;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO; using System.IO;
namespace FFMpegCore.Tests namespace FFMpegCore.Test
{ {
[TestClass] [TestClass]
public class AudioTest : BaseTest public class AudioTest : BaseTest

View file

@ -1,9 +1,8 @@
using System.Configuration; using FFMpegCore.FFMPEG;
using FFMpegCore.Test.Resources;
using System.IO; using System.IO;
using FFMpegCore.FFMPEG;
using FFMpegCore.Tests.Resources;
namespace FFMpegCore.Tests namespace FFMpegCore.Test
{ {
public class BaseTest public class BaseTest
{ {

View file

@ -0,0 +1,44 @@
using FFMpegCore.FFMPEG;
using FFMpegCore.FFMPEG.Exceptions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace FFMpegCore.Test
{
[TestClass]
public class FFMpegTest
{
[TestMethod]
public void CTOR_Default()
{
var encoder = new FFMpeg();
var probe = new FFProbe();
Assert.IsNotNull(encoder);
Assert.IsNotNull(probe);
}
[TestMethod]
public void CTOR_Options()
{
var encoder = new FFMpeg(new FFMpegOptions { RootDirectory = ".\\FFMPEG\\bin" });
var probe = new FFProbe(new FFMpegOptions { RootDirectory = ".\\FFMPEG\\bin" });
Assert.IsNotNull(encoder);
Assert.IsNotNull(probe);
}
[TestMethod]
[ExpectedException(typeof(FFMpegException))]
public void CTOR_Encoder_Options_Invalid()
{
var encoder = new FFMpeg(new FFMpegOptions { RootDirectory = "INVALID_DIR" });
}
[TestMethod]
[ExpectedException(typeof(FFMpegException))]
public void CTOR_Probe_Options_Invalid()
{
var encoder = new FFProbe(new FFMpegOptions { RootDirectory = "INVALID_DIR" });
}
}
}

View file

@ -2,7 +2,7 @@
using System.IO; using System.IO;
using FFMpegCore.Enums; using FFMpegCore.Enums;
namespace FFMpegCore.Tests.Resources namespace FFMpegCore.Test.Resources
{ {
public enum AudioType public enum AudioType
{ {

View file

@ -1,15 +1,15 @@
using FFMpegCore.Enums; using FFMpegCore.Enums;
using FFMpegCore.FFMPEG;
using FFMpegCore.FFMPEG.Argument; using FFMpegCore.FFMPEG.Argument;
using FFMpegCore.FFMPEG.Enums; using FFMpegCore.FFMPEG.Enums;
using FFMpegCore.Tests.Resources; using FFMpegCore.Test;
using FFMpegCore.Test.Resources;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
namespace FFMpegCore.Tests namespace FFMpegCore.Test
{ {
[TestClass] [TestClass]
public class VideoTest : BaseTest public class VideoTest : BaseTest