public async Task PutAsyncTest() { // Arrange var mockFacultyRepository = GetDefaultIFacultyRepositoryInstance(); var mockUniversityRepository = GetDefaultIUniversityRepositoryInstance(); var mockUnitOfWork = GetDefaultIUnitOfWorkInstance(); Faculty faculty = new Faculty(); int facultyId = 1; faculty.Id = facultyId; faculty.Name = "Ciencias"; Faculty facultyExpected = new Faculty(); facultyExpected.Name = "Letras"; mockFacultyRepository.Setup(r => r.FindById(facultyId)) .Returns(Task.FromResult <Faculty>(faculty)); var service = new FacultyService(mockFacultyRepository.Object, mockUniversityRepository.Object, mockUnitOfWork.Object); // Act FacultyResponse result = await service.UpdateASync(facultyId, facultyExpected); // Assert Assert.AreEqual(facultyExpected.Name, result.Resource.Name); }