public async Task TestGetAllServerExceptionShouldReturnErrorMessage() { var result = await controller.Get(); var badRequestResult = result as BadRequestObjectResult; Assert.IsNotNull(badRequestResult); Assert.AreEqual(400, badRequestResult.StatusCode); Assert.AreEqual("Could not fetch settlements", badRequestResult.Value as string); }
public async Task TestGetShouldReturnAllNodes() { var result = await controller.Get(); var jsonResult = result as JsonResult; var nodes = jsonResult?.Value as Node[]; Assert.IsNotNull(nodes); Assert.AreEqual(3, nodes.Length); }