mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-21 18:52:36 +01:00
Add DimensionTest to test project
A new test class, DimensionTest, is created and added to the test project. This class specifically tests the functionality of the Dimension object's validity and equality methods, thus enhancing our suite of unit tests. Signed-off-by: Ivandro Jao <ivandrofly@gmail.com>
This commit is contained in:
parent
6323937c30
commit
042dfa14e5
34
src/Test/Logic/DimensionTest.cs
Normal file
34
src/Test/Logic/DimensionTest.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Nikse.SubtitleEdit.Core.Common;
|
||||
|
||||
namespace Test.Logic
|
||||
{
|
||||
[TestClass]
|
||||
public class DimensionTest
|
||||
{
|
||||
[TestMethod]
|
||||
public void InvalidTest()
|
||||
{
|
||||
var dimension = new Dimension();
|
||||
Assert.AreEqual(0, dimension.Width);
|
||||
Assert.AreEqual(0, dimension.Height);
|
||||
Assert.IsTrue(!dimension.IsValid());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ValidTest()
|
||||
{
|
||||
var dimension = new Dimension(10, 10);
|
||||
Assert.IsTrue(dimension.IsValid());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void EqualityTest()
|
||||
{
|
||||
var dimensionOne = new Dimension();
|
||||
var dimensionTwo = new Dimension();
|
||||
Assert.AreEqual(dimensionOne, dimensionTwo);
|
||||
Assert.IsTrue(dimensionOne == dimensionTwo);
|
||||
}
|
||||
}
|
||||
}
|
@ -76,6 +76,7 @@
|
||||
<Compile Include="Logic\BeautifyTimeCodesTest.cs" />
|
||||
<Compile Include="Logic\ConvertColorsToDialogTest.cs" />
|
||||
<Compile Include="Core\LanguageAutoDetectLanguagesTest.cs" />
|
||||
<Compile Include="Logic\DimensionTest.cs" />
|
||||
<Compile Include="Logic\NetflixHelperTest.cs" />
|
||||
<Compile Include="Logic\SubtitleFormats\EbuStlTest.cs" />
|
||||
<Compile Include="Logic\SubtitleFormats\NetflixTimedTextTest.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user