public async Task DetailShouldBeSuccessful() { // Arrange service.Setup(s => s.DetailWithDescription(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())).Returns(Task.FromResult(new Detail())); settings.Setup(s => s.Value).Returns(new ApplicationSettings() { UrlItemDetail = "http://www.localhost.com/items/{0}", UrlItemDescription = "http://www.localhost.com/items/{0}/description" }); mapper.Setup(m => m.Map <DetailResponse>(It.IsAny <Detail>())).Returns(new DetailResponse()); // Action var result = await controller.Detail("MLA123456789"); // Assert Assert.IsInstanceOf <OkObjectResult>(result); Assert.IsNotNull(((OkObjectResult)result).Value); Assert.IsNotNull(((DetailResponse)((OkObjectResult)result).Value).Author); }