From 291eafeeba3932e8a198b2fb695cd2dddf760708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20B=C3=B6rchers?= Date: Wed, 29 Mar 2023 21:47:10 +0200 Subject: [PATCH] added unit tests --- SmallInjector.sln | 31 +++++++++++++++++++ .../SmallInjectorDemo.sln | 28 ++++++++--------- .../SmallInjectorDemo}/Helper.cs | 0 .../SmallInjectorDemo}/Interfaces/IClock.cs | 0 .../SmallInjectorDemo}/Interfaces/IModule.cs | 0 .../Interfaces/IServiceOne.cs | 0 .../Interfaces/IServiceTwo.cs | 0 .../SmallInjectorDemo}/Items/ModuleA.cs | 0 .../SmallInjectorDemo}/Items/ModuleB.cs | 0 .../SmallInjectorDemo}/Items/ModuleC.cs | 0 .../SmallInjectorDemo}/Program.cs | 0 .../SmallInjectorDemo}/ServiceConsumer.cs | 0 .../SmallInjectorDemo}/ServiceOne.cs | 0 .../SmallInjectorDemo}/ServiceTwo.cs | 0 .../SmallInjectorDemo.csproj | 2 +- .../SmallInjectorDemo}/SystemClock.cs | 0 .../SmallInjector.Tests.csproj | 19 ++++++++++++ src/SmallInjector.Tests/UnitTest1.cs | 16 ++++++++++ src/SmallInjector.Tests/Usings.cs | 1 + .../SmallInjector}/Container.cs | 0 .../SmallInjector}/IContainer.cs | 0 .../SmallInjector}/SmallInjector.csproj | 0 22 files changed, 82 insertions(+), 15 deletions(-) create mode 100644 SmallInjector.sln rename SmallInjectorDemo.sln => playground/SmallInjectorDemo.sln (73%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/Helper.cs (100%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/Interfaces/IClock.cs (100%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/Interfaces/IModule.cs (100%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/Interfaces/IServiceOne.cs (100%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/Interfaces/IServiceTwo.cs (100%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/Items/ModuleA.cs (100%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/Items/ModuleB.cs (100%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/Items/ModuleC.cs (100%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/Program.cs (100%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/ServiceConsumer.cs (100%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/ServiceOne.cs (100%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/ServiceTwo.cs (100%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/SmallInjectorDemo.csproj (82%) rename {SmallInjectorDemo => playground/SmallInjectorDemo}/SystemClock.cs (100%) create mode 100644 src/SmallInjector.Tests/SmallInjector.Tests.csproj create mode 100644 src/SmallInjector.Tests/UnitTest1.cs create mode 100644 src/SmallInjector.Tests/Usings.cs rename {SmallInjector => src/SmallInjector}/Container.cs (100%) rename {SmallInjector => src/SmallInjector}/IContainer.cs (100%) rename {SmallInjector => src/SmallInjector}/SmallInjector.csproj (100%) diff --git a/SmallInjector.sln b/SmallInjector.sln new file mode 100644 index 0000000..8c8aae8 --- /dev/null +++ b/SmallInjector.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33513.286 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SmallInjector", "src\SmallInjector\SmallInjector.csproj", "{32131173-49C5-4AB5-A949-36FA73D762BF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SmallInjector.Tests", "src\SmallInjector.Tests\SmallInjector.Tests.csproj", "{8EBD2440-A610-4165-8582-CD79F431BFCB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {32131173-49C5-4AB5-A949-36FA73D762BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {32131173-49C5-4AB5-A949-36FA73D762BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {32131173-49C5-4AB5-A949-36FA73D762BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {32131173-49C5-4AB5-A949-36FA73D762BF}.Release|Any CPU.Build.0 = Release|Any CPU + {8EBD2440-A610-4165-8582-CD79F431BFCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8EBD2440-A610-4165-8582-CD79F431BFCB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8EBD2440-A610-4165-8582-CD79F431BFCB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8EBD2440-A610-4165-8582-CD79F431BFCB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E9CBE7A5-3E64-491C-A930-B8845D7DF91E} + EndGlobalSection +EndGlobal diff --git a/SmallInjectorDemo.sln b/playground/SmallInjectorDemo.sln similarity index 73% rename from SmallInjectorDemo.sln rename to playground/SmallInjectorDemo.sln index e393e30..e43a46a 100644 --- a/SmallInjectorDemo.sln +++ b/playground/SmallInjectorDemo.sln @@ -5,13 +5,13 @@ VisualStudioVersion = 17.4.33103.184 MinimumVisualStudioVersion = 15.0.26124.0 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SmallInjectorDemo", "SmallInjectorDemo\SmallInjectorDemo.csproj", "{620CC001-7DF9-4233-AFC2-187FD9144835}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SmallInjector", "SmallInjector\SmallInjector.csproj", "{8D52C856-A71D-4C50-832B-8679CDD030B4}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{97F8F459-C4B4-4C40-A4CA-2443A9C245D9}" ProjectSection(SolutionItems) = preProject .csharpierrc = .csharpierrc EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SmallInjector", "..\src\SmallInjector\SmallInjector.csproj", "{41F6E1B4-C322-4743-9F9E-8A5C57EBA509}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -34,18 +34,18 @@ Global {620CC001-7DF9-4233-AFC2-187FD9144835}.Release|x64.Build.0 = Release|Any CPU {620CC001-7DF9-4233-AFC2-187FD9144835}.Release|x86.ActiveCfg = Release|Any CPU {620CC001-7DF9-4233-AFC2-187FD9144835}.Release|x86.Build.0 = Release|Any CPU - {8D52C856-A71D-4C50-832B-8679CDD030B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8D52C856-A71D-4C50-832B-8679CDD030B4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D52C856-A71D-4C50-832B-8679CDD030B4}.Debug|x64.ActiveCfg = Debug|Any CPU - {8D52C856-A71D-4C50-832B-8679CDD030B4}.Debug|x64.Build.0 = Debug|Any CPU - {8D52C856-A71D-4C50-832B-8679CDD030B4}.Debug|x86.ActiveCfg = Debug|Any CPU - {8D52C856-A71D-4C50-832B-8679CDD030B4}.Debug|x86.Build.0 = Debug|Any CPU - {8D52C856-A71D-4C50-832B-8679CDD030B4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8D52C856-A71D-4C50-832B-8679CDD030B4}.Release|Any CPU.Build.0 = Release|Any CPU - {8D52C856-A71D-4C50-832B-8679CDD030B4}.Release|x64.ActiveCfg = Release|Any CPU - {8D52C856-A71D-4C50-832B-8679CDD030B4}.Release|x64.Build.0 = Release|Any CPU - {8D52C856-A71D-4C50-832B-8679CDD030B4}.Release|x86.ActiveCfg = Release|Any CPU - {8D52C856-A71D-4C50-832B-8679CDD030B4}.Release|x86.Build.0 = Release|Any CPU + {41F6E1B4-C322-4743-9F9E-8A5C57EBA509}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {41F6E1B4-C322-4743-9F9E-8A5C57EBA509}.Debug|Any CPU.Build.0 = Debug|Any CPU + {41F6E1B4-C322-4743-9F9E-8A5C57EBA509}.Debug|x64.ActiveCfg = Debug|Any CPU + {41F6E1B4-C322-4743-9F9E-8A5C57EBA509}.Debug|x64.Build.0 = Debug|Any CPU + {41F6E1B4-C322-4743-9F9E-8A5C57EBA509}.Debug|x86.ActiveCfg = Debug|Any CPU + {41F6E1B4-C322-4743-9F9E-8A5C57EBA509}.Debug|x86.Build.0 = Debug|Any CPU + {41F6E1B4-C322-4743-9F9E-8A5C57EBA509}.Release|Any CPU.ActiveCfg = Release|Any CPU + {41F6E1B4-C322-4743-9F9E-8A5C57EBA509}.Release|Any CPU.Build.0 = Release|Any CPU + {41F6E1B4-C322-4743-9F9E-8A5C57EBA509}.Release|x64.ActiveCfg = Release|Any CPU + {41F6E1B4-C322-4743-9F9E-8A5C57EBA509}.Release|x64.Build.0 = Release|Any CPU + {41F6E1B4-C322-4743-9F9E-8A5C57EBA509}.Release|x86.ActiveCfg = Release|Any CPU + {41F6E1B4-C322-4743-9F9E-8A5C57EBA509}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SmallInjectorDemo/Helper.cs b/playground/SmallInjectorDemo/Helper.cs similarity index 100% rename from SmallInjectorDemo/Helper.cs rename to playground/SmallInjectorDemo/Helper.cs diff --git a/SmallInjectorDemo/Interfaces/IClock.cs b/playground/SmallInjectorDemo/Interfaces/IClock.cs similarity index 100% rename from SmallInjectorDemo/Interfaces/IClock.cs rename to playground/SmallInjectorDemo/Interfaces/IClock.cs diff --git a/SmallInjectorDemo/Interfaces/IModule.cs b/playground/SmallInjectorDemo/Interfaces/IModule.cs similarity index 100% rename from SmallInjectorDemo/Interfaces/IModule.cs rename to playground/SmallInjectorDemo/Interfaces/IModule.cs diff --git a/SmallInjectorDemo/Interfaces/IServiceOne.cs b/playground/SmallInjectorDemo/Interfaces/IServiceOne.cs similarity index 100% rename from SmallInjectorDemo/Interfaces/IServiceOne.cs rename to playground/SmallInjectorDemo/Interfaces/IServiceOne.cs diff --git a/SmallInjectorDemo/Interfaces/IServiceTwo.cs b/playground/SmallInjectorDemo/Interfaces/IServiceTwo.cs similarity index 100% rename from SmallInjectorDemo/Interfaces/IServiceTwo.cs rename to playground/SmallInjectorDemo/Interfaces/IServiceTwo.cs diff --git a/SmallInjectorDemo/Items/ModuleA.cs b/playground/SmallInjectorDemo/Items/ModuleA.cs similarity index 100% rename from SmallInjectorDemo/Items/ModuleA.cs rename to playground/SmallInjectorDemo/Items/ModuleA.cs diff --git a/SmallInjectorDemo/Items/ModuleB.cs b/playground/SmallInjectorDemo/Items/ModuleB.cs similarity index 100% rename from SmallInjectorDemo/Items/ModuleB.cs rename to playground/SmallInjectorDemo/Items/ModuleB.cs diff --git a/SmallInjectorDemo/Items/ModuleC.cs b/playground/SmallInjectorDemo/Items/ModuleC.cs similarity index 100% rename from SmallInjectorDemo/Items/ModuleC.cs rename to playground/SmallInjectorDemo/Items/ModuleC.cs diff --git a/SmallInjectorDemo/Program.cs b/playground/SmallInjectorDemo/Program.cs similarity index 100% rename from SmallInjectorDemo/Program.cs rename to playground/SmallInjectorDemo/Program.cs diff --git a/SmallInjectorDemo/ServiceConsumer.cs b/playground/SmallInjectorDemo/ServiceConsumer.cs similarity index 100% rename from SmallInjectorDemo/ServiceConsumer.cs rename to playground/SmallInjectorDemo/ServiceConsumer.cs diff --git a/SmallInjectorDemo/ServiceOne.cs b/playground/SmallInjectorDemo/ServiceOne.cs similarity index 100% rename from SmallInjectorDemo/ServiceOne.cs rename to playground/SmallInjectorDemo/ServiceOne.cs diff --git a/SmallInjectorDemo/ServiceTwo.cs b/playground/SmallInjectorDemo/ServiceTwo.cs similarity index 100% rename from SmallInjectorDemo/ServiceTwo.cs rename to playground/SmallInjectorDemo/ServiceTwo.cs diff --git a/SmallInjectorDemo/SmallInjectorDemo.csproj b/playground/SmallInjectorDemo/SmallInjectorDemo.csproj similarity index 82% rename from SmallInjectorDemo/SmallInjectorDemo.csproj rename to playground/SmallInjectorDemo/SmallInjectorDemo.csproj index b829db8..47e0c4d 100644 --- a/SmallInjectorDemo/SmallInjectorDemo.csproj +++ b/playground/SmallInjectorDemo/SmallInjectorDemo.csproj @@ -8,6 +8,6 @@ enable - + \ No newline at end of file diff --git a/SmallInjectorDemo/SystemClock.cs b/playground/SmallInjectorDemo/SystemClock.cs similarity index 100% rename from SmallInjectorDemo/SystemClock.cs rename to playground/SmallInjectorDemo/SystemClock.cs diff --git a/src/SmallInjector.Tests/SmallInjector.Tests.csproj b/src/SmallInjector.Tests/SmallInjector.Tests.csproj new file mode 100644 index 0000000..cbb7690 --- /dev/null +++ b/src/SmallInjector.Tests/SmallInjector.Tests.csproj @@ -0,0 +1,19 @@ + + + + net7.0 + enable + enable + + false + + + + + + + + + + + diff --git a/src/SmallInjector.Tests/UnitTest1.cs b/src/SmallInjector.Tests/UnitTest1.cs new file mode 100644 index 0000000..5bdbcdf --- /dev/null +++ b/src/SmallInjector.Tests/UnitTest1.cs @@ -0,0 +1,16 @@ +namespace SmallInjector.Tests +{ + public class Tests + { + [SetUp] + public void Setup() + { + } + + [Test] + public void Test1() + { + Assert.Pass(); + } + } +} \ No newline at end of file diff --git a/src/SmallInjector.Tests/Usings.cs b/src/SmallInjector.Tests/Usings.cs new file mode 100644 index 0000000..cefced4 --- /dev/null +++ b/src/SmallInjector.Tests/Usings.cs @@ -0,0 +1 @@ +global using NUnit.Framework; \ No newline at end of file diff --git a/SmallInjector/Container.cs b/src/SmallInjector/Container.cs similarity index 100% rename from SmallInjector/Container.cs rename to src/SmallInjector/Container.cs diff --git a/SmallInjector/IContainer.cs b/src/SmallInjector/IContainer.cs similarity index 100% rename from SmallInjector/IContainer.cs rename to src/SmallInjector/IContainer.cs diff --git a/SmallInjector/SmallInjector.csproj b/src/SmallInjector/SmallInjector.csproj similarity index 100% rename from SmallInjector/SmallInjector.csproj rename to src/SmallInjector/SmallInjector.csproj