.NET Core Web App
April 27, 2020
Create a .NET Core C# web application that renders a list of random names api. Load Names from an API, where the URI for API is set in an appSettings file. Use the Configuration IOptions pattern and the HttpClientFactory factory class. Create a test using Moq and xUnit, and return Stub from HttpMessageHandler. Use a different API URI per environment.
Requirements:
-
Create an .NET Core web app using the
dotnetCLI and add to asrcfolder -
Create an xunit project using the
dotnetCLI and add to thesrcfolder -
Add the
.NET Core web appproject reference to thetestproject -
Add the
Moqnuget package to thetestproject -
TBC
Tech:
- .NET Core 3.1
- xUnit
- Moq
References
Hint 1
dotnet new webapp -n foo -o baa/src/foo
dotnet new xunit -n test -o baa/src/test
dotnet add baa/src/test reference baa/src/foo
dotnet add baa/src/test package Moq