public async void GetbyBusinessName_CallsGetbyBusinessOnMockRepo_ReturnsOkObjectResult() { //Arrange string expectedName = "Test"; mockRepo.Setup(repo => repo.GetbyBusinessName(expectedName)).Returns(Task.FromResult <Business>(new Business { BusinessName = expectedName })); //Act var result = await controller.GetbyBusinessName(expectedName); var resultObj = result as OkObjectResult; //Asset mockRepo.Verify(repo => repo.GetbyBusinessName(expectedName), Times.Once); Assert.NotNull(resultObj); Assert.Equal(200, resultObj.StatusCode); }