From f5d39071afdd536783f66cfd04b362dc0900a059 Mon Sep 17 00:00:00 2001 From: Zhang Hua Date: Tue, 21 May 2024 19:56:15 +0800 Subject: [PATCH] Add some unit tests --- E5Renewer.Tests/TypeArrayExtendsTests.cs | 25 +++++++++++++++++++ E5Renewer.Tests/UnitTest1.cs | 10 -------- E5Renewer.Tests/WebApplicationExtendsTests.cs | 10 ++++++++ 3 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 E5Renewer.Tests/TypeArrayExtendsTests.cs delete mode 100644 E5Renewer.Tests/UnitTest1.cs create mode 100644 E5Renewer.Tests/WebApplicationExtendsTests.cs diff --git a/E5Renewer.Tests/TypeArrayExtendsTests.cs b/E5Renewer.Tests/TypeArrayExtendsTests.cs new file mode 100644 index 0000000..49e10c2 --- /dev/null +++ b/E5Renewer.Tests/TypeArrayExtendsTests.cs @@ -0,0 +1,25 @@ +namespace E5Renewer.Tests; + +/// +/// Test +/// +/// +[TestClass] +public class TypeArrayExtendsTests +{ + private void TestGetNonAbstractClassesAssainableToHelper(uint count) + { + IEnumerable typesFound = typeof(TypeArrayExtendsTests).Assembly.GetTypes().GetNonAbstractClassesAssainableTo(); + Assert.AreEqual((int)count, typesFound.Count()); + } + + /// + /// Test + /// + /// + [TestMethod] + public void TestGetNonAbstractClassesAssainableTo() + { + this.TestGetNonAbstractClassesAssainableToHelper(1); + } +} diff --git a/E5Renewer.Tests/UnitTest1.cs b/E5Renewer.Tests/UnitTest1.cs deleted file mode 100644 index 4ce42a5..0000000 --- a/E5Renewer.Tests/UnitTest1.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace E5Renewer.Tests; - -[TestClass] -public class UnitTest1 -{ - [TestMethod] - public void TestMethod1() - { - } -} \ No newline at end of file diff --git a/E5Renewer.Tests/WebApplicationExtendsTests.cs b/E5Renewer.Tests/WebApplicationExtendsTests.cs new file mode 100644 index 0000000..171e882 --- /dev/null +++ b/E5Renewer.Tests/WebApplicationExtendsTests.cs @@ -0,0 +1,10 @@ +namespace E5Renewer.Tests; + +/// Test +/// . +/// +[TestClass] +public class WebApplicationExtendsTests +{ + +}