[dotnet] Add dotnet projects and examples
+ Sitemap generator I created while learning the dispose pattern + Testing project for learning general C#
This commit is contained in:
27
dotnet/testing/KlipsLibrary.Test/KlipsLibrary.Test.csproj
Normal file
27
dotnet/testing/KlipsLibrary.Test/KlipsLibrary.Test.csproj
Normal file
@@ -0,0 +1,27 @@
|
||||
<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="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\KlipsLibrary\KlipsLibrary.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
22
dotnet/testing/KlipsLibrary.Test/UnitTest1.cs
Normal file
22
dotnet/testing/KlipsLibrary.Test/UnitTest1.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Xunit;
|
||||
|
||||
namespace KlipsLibrary.Test;
|
||||
|
||||
public class UnitTest1
|
||||
{
|
||||
[Fact]
|
||||
public void DogTest()
|
||||
{
|
||||
var dog = new Dog("Buford", "Woof");
|
||||
Assert.Equal("Buford", dog.Name);
|
||||
dog.Speak();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HumanTest()
|
||||
{
|
||||
var human = new Human("Shaun", "Hi");
|
||||
Assert.Equal("Shaun", human.Name);
|
||||
human.Speak();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user