public async Task UpdateVendor_ReturnsTrue() { // arrange var vendor = new Vendor { id = 123, userName = "******", name = "name1", website = "website_1" }; var address = new Address { id = 456, userName = "******", street = "123 Main St", city = "State College", state = "PA", zip = 16803 }; _vendorsQueryMock.Setup(x => x.Update(vendor)) .Returns(Task.Factory.StartNew(() => vendor)); _addressQueryMock.Setup(x => x.GetByUserName("*****@*****.**")) .Returns(Task.Factory.StartNew(() => address)); _vendorsQueryMock.Setup(x => x.GetByUserName("*****@*****.**")) .Returns(Task.Factory.StartNew(() => vendor)); // act var task = await _sut.Update(vendor); // assert Assert.IsType <OkObjectResult>(task); var result = task as OkObjectResult; Assert.Equal(true, result.Value); }