From 042dfa14e5e0275956476de46c82b4b88bf6f6b9 Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Tue, 30 Apr 2024 13:10:10 +0100 Subject: [PATCH] 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 --- src/Test/Logic/DimensionTest.cs | 34 +++++++++++++++++++++++++++++++++ src/Test/Test.csproj | 1 + 2 files changed, 35 insertions(+) create mode 100644 src/Test/Logic/DimensionTest.cs diff --git a/src/Test/Logic/DimensionTest.cs b/src/Test/Logic/DimensionTest.cs new file mode 100644 index 000000000..c43ad570c --- /dev/null +++ b/src/Test/Logic/DimensionTest.cs @@ -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); + } + } +} \ No newline at end of file diff --git a/src/Test/Test.csproj b/src/Test/Test.csproj index 0bbe85949..c0c2f74a0 100644 --- a/src/Test/Test.csproj +++ b/src/Test/Test.csproj @@ -76,6 +76,7 @@ +