Testing a web app
Last updated
Last updated
This is a simple asp.net core Razor Pages application to calculate the age of a person when he enters his date of birth in the home page. The result is shown in a second page after he click the submit.
The VSCode solution has 3 projects- one to hold the core logic (a class library), another to perform the testing of this core logic (XUnit project) and finally the last one is the actual web application for the end user.
VSCode IDE
C# Extension for VS Code
.NET Core Test Explorer (for visual interface)
Close visual studio code and any command prompts if open
Open a command to the inner folder where the app is cloned, example C:\Users\ravi_\Source\repos\Temp\KnowYourAge\KnowYourAge
Issue the command code .
(This should load the project in VSCode properly)
Accept any suggestions by VS Code to restore assets, packages or extensions
Use ctrl and F5 keys to run the application!
Accept any prompts regarding security certificate from your browser
Your browser may warn about connection, click Advanced
and then click the localhost.... link to start browsing the app!
You could also try installing the certificate manually as shown below:
If you need to know how the project structure was created using VSCode and .net CLI, you can look into documentation.