public async Task FindByIdAsyncTest() { // Arrange var lookup = new Category { Id = 3, Name = "Twitter" }; _mockLookupRepository.Setup(x => x.FindByIdAsync(3)).ReturnsAsync(lookup); // Act var response = await _lookupService.FindByIdAsync(3); // Assert Assert.IsTrue(response.Success); Assert.AreEqual(string.Empty, response.Message); Assert.AreEqual(3, response.Resource.Id); Assert.AreEqual("TWITTER", response.Resource.Name.ToUpper()); }
public async Task <IActionResult> FindByIdAsync(int id) { return(Ok(await _lookupService.FindByIdAsync(id))); }