mkdir MyProject
cd MyProject
mkdir src test
dotnet new classlib -o src/Library
dotnet new xunit -o test/Library.Tests
dotnet add test/Library.Tests/Library.Tests.csproj reference src/Library/Library.csproj
dotnet new webapi -o src/WebApi
dotnet new console -o src/MyConsole
dotnet test test/Library.Tests/Library.Tests.csproj
Or run and watch for changes
dotnet watch --project test/Library.Tests/ test
-n is optional, will default to folder name
dotnet new sln -n MyProject
dotnet sln MyProject.sln add src/Library/Library.csproj test/Library.Tests/Library.Tests.csproj
dotnet test MyProject.sln
Or run and watch tests from solution
dotnet watch --project MyProject.sln test
touch input.txt
dotnet run --project src/MyConsole/MyConsole.csproj < input.txt