add NUnit test framework

This commit is contained in:
Greg Gauthier 2023-01-05 11:09:31 +00:00
parent 94a78a3b82
commit 4805185185
5 changed files with 54 additions and 0 deletions

View File

@ -11,6 +11,15 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit.Analyzers" Version="3.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit.Console" Version="3.16.1" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.16.1" />
<PackageReference Include="NUnit.Runners" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>

View File

@ -2,6 +2,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddressBookApi", "AddressBookApi.csproj", "{1A01A987-3E73-4A01-984D-75634614B5B7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddressBookApiTests", "AddressBookApiTests\AddressBookApiTests.csproj", "{26616613-BE06-4811-85CB-72930ABE4EE4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -12,5 +14,9 @@ Global
{1A01A987-3E73-4A01-984D-75634614B5B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A01A987-3E73-4A01-984D-75634614B5B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A01A987-3E73-4A01-984D-75634614B5B7}.Release|Any CPU.Build.0 = Release|Any CPU
{26616613-BE06-4811-85CB-72930ABE4EE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{26616613-BE06-4811-85CB-72930ABE4EE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26616613-BE06-4811-85CB-72930ABE4EE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26616613-BE06-4811-85CB-72930ABE4EE4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
<PackageReference Include="coverlet.collector" Version="3.1.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AddressBookApi.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,15 @@
namespace AddressBookApiTests;
public class Tests
{
[SetUp]
public void Setup()
{
}
[Test]
public void Test1()
{
Assert.Pass();
}
}

View File

@ -0,0 +1 @@
global using NUnit.Framework;