public async Task TestGetLogisticCenterIdServerExceptionShouldReturnErrorMessage()
        {
            var result = await controller.GetLogisticCenterId();

            var badRequestResult = result as BadRequestObjectResult;

            Assert.IsNotNull(badRequestResult);
            Assert.AreEqual(400, badRequestResult.StatusCode);
            Assert.AreEqual("Something went wrong when fetching logistic center id.", badRequestResult.Value as string);
        }
Пример #2
0
        public async Task TestGetLogisticCenterIdShouldReturnCorrectId()
        {
            var result = await controller.GetLogisticCenterId();

            var jsonResult = result as JsonResult;

            var id = jsonResult?.Value as int?;

            Assert.IsNotNull(id);
            Assert.AreEqual(1, id);
        }