.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
dotnet
CLI and add to asrc
folder -
Create an xunit project using the
dotnet
CLI and add to thesrc
folder -
Add the
.NET Core web app
project reference to thetest
project -
Add the
Moq
nuget package to thetest
project -
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