Adding test configuration
This commit is contained in:
25
MainProject.Tests/AppSettingsUtils_Tests.cs
Normal file
25
MainProject.Tests/AppSettingsUtils_Tests.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using BasicDotnetTemplate.MainProject.Models.Settings;
|
||||
using BasicDotnetTemplate.MainProject.Utils;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace BasicDotnetTemplate.MainProject.Tests
|
||||
{
|
||||
[TestClass]
|
||||
public class AppSettingsUtils_Tests
|
||||
{
|
||||
private readonly AppSettings _appSettings;
|
||||
|
||||
public AppSettingsUtils_Tests()
|
||||
{
|
||||
_appSettings = new AppSettings();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AppSettingsUtils_Tests_IsValid()
|
||||
{
|
||||
bool result = AppSettingsUtils.CheckAppSettings(_appSettings);
|
||||
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
MainProject.Tests/MainProject.Tests.csproj
Normal file
27
MainProject.Tests/MainProject.Tests.csproj
Normal file
@@ -0,0 +1,27 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MainProject\MainProject.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user