Пример #1
0
        public void TestGetHotelBrands_Exception_InternalServerError()
        {
            int id = 1;

            RedisCacheHelper.Instance.Remove(Constants.CacheKeys.HotelBrandList);
            mockMasterDataRepository.Setup(a => a.GetHotelBrands()).Returns(Task.FromResult(new BaseResult <List <HotelBrand> > {
                IsError = true, ExceptionMessage = new Exception()
            }));
            Task <IActionResult> actionResult = mockMasterDataController.GetHotelBrands(id);

            Assert.IsTrue(actionResult != null);
            Assert.AreEqual(((Microsoft.AspNetCore.Mvc.StatusCodeResult)actionResult.Result).StatusCode, 500);
        }