Monthly Archives: May 2019

Creating dotnet solution, project and test project with cli

This is a good source. 

mkidr MyConsoleProjectWithUnitTest
cd MyConsoleProjectWithUnitTest/
dotnet new sln
mkdir HelloWorldConsole
cd HelloWorldConsole/
dotnet new console
dotnet run
cd ..
mkdir HelloWorldConsole.Tests
cd HelloWorldConsole.Tests/
dotnet new mstest 
dotnet add reference ../HelloWorldConsole/HelloWorldConsole.csproj 
cd ..
dotnet sln add HelloWorldConsole/HelloWorldConsole.csproj 
dotnet sln add HelloWorldConsole.Tests/HelloWorldConsole.Tests.csproj
code . 
# Make modifications to your tests, program. 
Cd HelloWorldConsole.Tests
dotnet test