public async Task PartService_Should_Update_Part() { // Arrange SetUpUnitOfWork(); var service = new PartService(_unitOfWork.Object, _mapper); var entity = new PartDTO() { Name = "TestName", Code = "12345", }; var newEntity = new PartDTO() { Name = "NewTestName", Code = "12345678", }; await service.CreateAsync(entity); await _unitOfWork.Object.SaveAsync(); // Act entity.Name = newEntity.Name; entity.Code = newEntity.Code; await service.UpdateAsync(entity); await _unitOfWork.Object.SaveAsync(); // Assert Assert.NotNull(entity); Assert.Equal(newEntity.Name, entity.Name); Assert.Equal(newEntity.Code, entity.Code); }