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);
        }
Example #2
0
        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);
        }