public void TestGetMarketIncludedAndExcludedCountries_Exception_InternalServerError() { int marketId = 12; mockMarketRepository.Setup(a => a.GetMarketIncludedAndExcludedCountries(marketId)).Returns(Task.FromResult(new BaseResult <List <MarketIncludedAndExcludedCountries> > { IsError = true, ExceptionMessage = Helper.Common.GetMockException() })); Task <IActionResult> actionResult = mockMarketontroller.GetMarketIncludedAndExcludedCountries(marketId); Assert.IsTrue(actionResult != null); Assert.AreEqual(((Microsoft.AspNetCore.Mvc.StatusCodeResult)actionResult.Result).StatusCode, 500); }