kurozakizz / dotnet-testing

.NET Unit Test Lab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install .NET SDK

.NET SDK Info

dotnet --info

Info

Solution

dotnet new sln
dotnet new xunit -o LogAnalyzer
dotnet sln dotnet-testing.sln add LogAnalyzer/LogAnalyzer.csproj
dotnet sln list

Create new xunit project

dotnet new xunit -o dotnet-testing
cd dotnet-testing

Run test

dotnet test

Use [Theory]

Example of inject test data as a list of test case into single test case

LogAnalyzer.cs

LogAnalyzer

LogAnalyzerTests.cs

LogAnalyzerTests

Use [Fact]

Example of split test case into each case

MemCalculator.cs

MemCalculator

MemCalcualtorTests.cs

MemCalculatorTests

About

.NET Unit Test Lab


Languages

Language:C# 100.0%