This project use for example of Smoke test it contain 3 project
SmokeTestLogin.sln
|-- SmokeTestLogin.Data
|-- SmokeTestLogin.Web
|-- SmokeTestLogin.Test
|-- SmokeTestLogin.Logic
- SmokeTestLogin.Data contains code for table definition, a MainContext class for Entity Framework Core
- SmokeTestLogin.Web contains ASP.NET CORE MVC , it only has single
Home
andLogin
view, with simple MustLoginAttribute to handle authenticate filter - SmokeTestLogin.Test project contain MSTest code for testing, two class LoginTest for test login, logout, or authorization checking, UserFunctionTest for test user create, read, update, delete
- SmokeTestLogin.Logic for logic login and CRUD operation
SQLite database is used for sake of simple, only Entity Framework Core is required, anything else is native ASP.NET CORE, Bogus.Faker is used for generating fake data, but can be remove
- ensure dotnet sdk at least 6 is installed, or Visual Studio 2022 with Web development workload installed
- prefer open terminal or bash in Linux to scaffold database (Note it's already had Seed Data)
:: ensure stay in solution Directory
dotnet restore
dotnet tool install -- global dotnet-ef --version 7.0.10
dotnet ef database update --project .\SmokeTestLogin.Data\SmokeTestLogin.Data.csproj --startup-project .\SmokeTestLogin\SmokeTestLogin.Web.csproj
:: for mac / linux
:: dotnet ef database update --project ./SmokeTestLogin.Data/SmokeTestLogin.Data.csproj --startup-project ./SmokeTestLogin/SmokeTestLogin.Web.csproj
- after database has been update, simple build in visual studio or run
dotnet build
Password generate can be found at here