I\'m in the process of building an ASP.NET Core WebAPI and I\'m attempting to write unit tests for the controllers. Most examples I\'ve found are from the older WebAPI/WebA
var result = await controller.GetOrders();//
var okResult = result as ObjectResult;
// assert
Assert.NotNull(okResult);
Assert.True(okResult is OkObjectResult);
Assert.IsType(okResult.Value);
Assert.Equal(StatusCodes.Status200OK, okResult.StatusCode);