.NET Core Web App

.NET Core Web App

April 27, 2020
.net core, moq, xunit

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:

  1. Create an .NET Core web app using the dotnet CLI and add to a src folder

  2. Create an xunit project using the dotnet CLI and add to the src folder

  3. Add the .NET Core web app project reference to the test project

  4. Add the Moq nuget package to the test project

  5. 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