public void TestGetBranchesByAgencyIdReturnOkSuccess() { List <BranchResponseModel> fakeBranchResponseList = new List <BranchResponseModel>(); fakeBranchResponseList = this.GetFakeListOfBranchResponseModel(); branchMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new BaseResult <List <BranchResponseModel> > { Result = fakeBranchResponseList, IsError = false })); var result = branchController.GetBranchByAgancyId(5).Result; BaseResult <List <BranchResponseModel> > resultList = (result as OkObjectResult).Value as BaseResult <List <BranchResponseModel> >; Assert.That(result is OkObjectResult); }