Пример #1
0
        public void TestGetCountries_Exception_InternalServerError()
        {
            RedisCacheHelper.Instance.Remove(Constants.CacheKeys.CountryList);
            mockMasterDataRepository.Setup(a => a.GetCountries()).Returns(Task.FromResult(new BaseResult <List <Country> > {
                IsError = true, ExceptionMessage = new Exception()
            }));

            Task <IActionResult> actioResult = mockMasterDataController.GetCountries();

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