Skip to content

Instantly share code, notes, and snippets.

@johannesprinz
Last active March 19, 2021 04:48
Show Gist options
  • Save johannesprinz/8fefcf3845e6c136eb43076e07031301 to your computer and use it in GitHub Desktop.
Save johannesprinz/8fefcf3845e6c136eb43076e07031301 to your computer and use it in GitHub Desktop.
Dotnet Core - Clean Architecture Scaffold
# Outside of shell
# - Create project directory
# - git init
# - open in vs code >code .
# - Using remote container extensions create new development container
# - Using dotnet core 3.1 or later container template
# - Re-open in container and run the script below
dotnet new sln
dotnet new xunit -n Application.IntegrationTests -o ./tests/Application.IntegrationTests
dotnet sln add ./tests/Application.IntegrationTests/Application.IntegrationTests.csproj
dotnet new xunit -n Application.UnitTests -o ./tests/Application.UnitTests
dotnet sln add ./tests/Application.UnitTests/Application.UnitTests.csproj
dotnet new xunit -n Domain.UnitTests -o ./tests/Domain.UnitTests
dotnet sln add ./tests/Domain.UnitTests/Domain.UnitTests.csproj
dotnet new classlib -n Application -o ./src/Application
dotnet sln add ./src/Application/Application.csproj
dotnet new classlib -n Domain -o ./src/Domain
dotnet sln add ./src/Domain/Domain.csproj
dotnet new classlib -n Infrastructure -o ./src/Infrastructure
dotnet sln add ./src/Infrastructure/Infrastructure.csproj
dotnet add ./src/Application/Application.csproj reference ./src/Domain/Domain.csproj
dotnet add ./src/Infrastructure/Infrastructure.csproj reference ./src/Application/Application.csproj
dotnet add ./tests/Domain.UnitTests/Domain.UnitTests.csproj reference ./src/Domain/Domain.csproj
dotnet add ./tests/Application.UnitTests/Application.UnitTests.csproj reference ./src/Application/Application.csproj
dotnet add ./tests/Application.UnitTests/Application.UnitTests.csproj reference ./src/Infrastructure/Infrastructure.csproj
dotnet add tests/Domain.UnitTests/Domain.UnitTests.csproj package Moq
dotnet add tests/Domain.UnitTests/Domain.UnitTests.csproj package AutoFixture
dotnet add tests/Domain.UnitTests/Domain.UnitTests.csproj package AutoFixture.AutoMoq
dotnet add tests/Domain.UnitTests/Domain.UnitTests.csproj package FluentAssertions
dotnet add tests/Application.UnitTests/Application.UnitTests.csproj package Moq
dotnet add tests/Application.UnitTests/Application.UnitTests.csproj package AutoFixture
dotnet add tests/Application.UnitTests/Application.UnitTests.csproj package AutoFixture.AutoMoq
dotnet add tests/Application.UnitTests/Application.UnitTests.csproj package FluentAssertions
dotnet add tests/Application.IntegrationTests/Application.IntegrationTests.csproj package Moq
dotnet add tests/Application.IntegrationTests/Application.IntegrationTests.csproj package AutoFixture
dotnet add tests/Application.IntegrationTests/Application.IntegrationTests.csproj package AutoFixture.AutoMoq
dotnet add tests/Application.IntegrationTests/Application.IntegrationTests.csproj package FluentAssertions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment