public async Task TestGetStarRating_Exception_InternalServerError() { RedisCacheHelper.Instance.Remove(Constants.CacheKeys.StarRatingList); mockMasterDataRepository.Setup(a => a.GetStarRating()).Returns(Task.FromResult(new BaseResult <List <StarRating> > { IsError = true, ExceptionMessage = Helper.Common.GetMockException() })); IActionResult actionResult = await mockMasterDataController.GetStarRating(); Assert.IsTrue(actionResult != null); Assert.AreEqual(((Microsoft.AspNetCore.Mvc.StatusCodeResult)actionResult).StatusCode, 500); }