One-time password generator
is an web application which allows authenticated users to generate random passwords which expires at an interval of 30 seconds after creation.
Table of contents:
- Prerequisites
- Running the solution
- Build solution
- Running tests
- Unit tests
- Integration tests
- Acceptance tests
- Code Coverage
- Database commands
-
Install latest NET Core 6 SDK, then check if dotnet is installed by running next command:
dotnet --version
-
Restore tools used in development by running next command:
dotnet tool restore
-
To run the application via
dotnet
execute command and open browser at URL https://localhost:7010/:dotnet run --project ./src/Server
-
Open browser at URL https://localhost:7056 and login or create a new account.
-
Check build runs on CI --or--
-
On the
root folder
run next command:dotnet build
-
Check test runs on CI --or--
-
On the
root folder
run next command:dotnet cake --task=test
-
The above command will also generated coverage results which can open automatically if option
open-coverage-results
is present:dotnet cake --task=test --open-coverage-results
-
Check test runs on CI --or--
-
On the
root folder
run next command:dotnet cake --task=unit-tests
-
Check test runs on CI --or--
-
On the
root folder
run next command:dotnet cake --task=integration-tests
-
Check test runs on CI --or--
-
On the
root folder
run next command:dotnet cake --task=acceptance-tests
-
Check coverage reports on CI --or--
-
On the
root folder
run next command:dotnet cake --task=code-coverage
-
Generated coverage results are open automatically if option
open-coverage-results
is present:dotnet cake --task=code-coverage --open-coverage-results
In order to use any of the [ef commands][ef-commands] we need to:
- specify
./src/Infrastructure
as the--project
(since there we keep the database configurations) - specify
./src/Server
as the--startup-project
(since the Server includes the Client) - and in case of working with
ef migrations add
command, specifyPersistence/Migrations
as the--output-dir
.
Handy commands:
-
update database
:dotnet ef database update --project ./src/Infrastructure --startup-project ./src/Server
-
drop database
dotnet ef database drop --project ./src/Infrastructure --startup-project ./src/Server
-
add migration
:dotnet ef migrations add "MigrationName" --project ./src/Infrastructure --startup-project ./src/Server --output-dir Persistence/Migrations
-
remove migration
:dotnet ef migrations remove --project ./src/Infrastructure --startup-project ./src/Server