See the example below
mkdir InvoiceSolution && cd InvoiceSolution
dotnet new sln -n InvoiceSolution
dotnet new console -n InvoiceApp
dotnet new xunit -n InvoiceApp.Tests
dotnet sln add InvoiceApp/InvoiceApp.csproj
dotnet sln add InvoiceApp.Tests/InvoiceApp.Tests.csproj
dotnet add InvoiceApp.Tests reference InvoiceApp
dotnet add InvoiceApp package Microsoft.Extensions.Hosting dotnet add InvoiceApp package Microsoft.Extensions.DependencyInjection
dotnet run --project InvoiceApp
dotnet test
If you know git you can use the following tutorial: