From 96ea8eea6ccd317af071c1c5d060e3932a7d35e9 Mon Sep 17 00:00:00 2001 From: Dan <daniel2.lorych@live.uwe.ac.uk> Date: Sat, 23 Apr 2022 20:26:05 +0100 Subject: [PATCH] Add unit tests --- Helios.sln | 6 ++++++ UnitTests/ConfiguratorTests.cs | 20 ++++++++++++++++++++ UnitTests/PowerDistributionTests.cs | 20 ++++++++++++++++++++ UnitTests/SystemMonitoringTests.cs | 20 ++++++++++++++++++++ UnitTests/UnitTests.csproj | 17 +++++++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 UnitTests/ConfiguratorTests.cs create mode 100644 UnitTests/PowerDistributionTests.cs create mode 100644 UnitTests/SystemMonitoringTests.cs create mode 100644 UnitTests/UnitTests.csproj diff --git a/Helios.sln b/Helios.sln index 309b449..190dc3e 100644 --- a/Helios.sln +++ b/Helios.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 25.0.1700.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Helios", "Helios\Helios.csproj", "{A78C7747-3479-4E7B-A724-C29E1E28142F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{ECA6B093-982F-44B8-9E6A-833FC77BB86F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {A78C7747-3479-4E7B-A724-C29E1E28142F}.Debug|Any CPU.Build.0 = Debug|Any CPU {A78C7747-3479-4E7B-A724-C29E1E28142F}.Release|Any CPU.ActiveCfg = Release|Any CPU {A78C7747-3479-4E7B-A724-C29E1E28142F}.Release|Any CPU.Build.0 = Release|Any CPU + {ECA6B093-982F-44B8-9E6A-833FC77BB86F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECA6B093-982F-44B8-9E6A-833FC77BB86F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECA6B093-982F-44B8-9E6A-833FC77BB86F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECA6B093-982F-44B8-9E6A-833FC77BB86F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/UnitTests/ConfiguratorTests.cs b/UnitTests/ConfiguratorTests.cs new file mode 100644 index 0000000..2245f21 --- /dev/null +++ b/UnitTests/ConfiguratorTests.cs @@ -0,0 +1,20 @@ +using System; +using NUnit.Framework; + +namespace UnitTests +{ + public class ConfiguratorTests + { + [SetUp] + public void Setup() + { + } + + [Test] + public void Test1() + { + Assert.Pass(); + } + } +} + diff --git a/UnitTests/PowerDistributionTests.cs b/UnitTests/PowerDistributionTests.cs new file mode 100644 index 0000000..3ee39f6 --- /dev/null +++ b/UnitTests/PowerDistributionTests.cs @@ -0,0 +1,20 @@ +using System; +using NUnit.Framework; + +namespace UnitTests +{ + public class PowerDistributionTests + { + [SetUp] + public void Setup() + { + } + + [Test] + public void Test1() + { + Assert.Pass(); + } + } +} + diff --git a/UnitTests/SystemMonitoringTests.cs b/UnitTests/SystemMonitoringTests.cs new file mode 100644 index 0000000..aa8c5d1 --- /dev/null +++ b/UnitTests/SystemMonitoringTests.cs @@ -0,0 +1,20 @@ +using System; +using NUnit.Framework; + +namespace UnitTests +{ + public class SystemMonitoringTests + { + [SetUp] + public void Setup() + { + } + + [Test] + public void Test1() + { + Assert.Pass(); + } + } +} + diff --git a/UnitTests/UnitTests.csproj b/UnitTests/UnitTests.csproj new file mode 100644 index 0000000..e59718e --- /dev/null +++ b/UnitTests/UnitTests.csproj @@ -0,0 +1,17 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net6.0</TargetFramework> + <Nullable>enable</Nullable> + + <IsPackable>false</IsPackable> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> + <PackageReference Include="NUnit" Version="3.13.2" /> + <PackageReference Include="NUnit3TestAdapter" Version="4.0.0" /> + <PackageReference Include="coverlet.collector" Version="3.1.0" /> + </ItemGroup> + +</Project> -- GitLab