public void UpdateDataInvalidFieldsTest() { var provider = new ProviderMock(); var repository = new RepositoryMock(provider); var record = new TesteEntity(); var result = repository.UpdateData(new TesteEntity(), e => e.Id == record.Id); Assert.True(result.Count(c => c.MessageType.Equals(nameof(FieldValueException))) == 4); }
public void UpdateDataRecordNotFoundTest() { var provider = new ProviderMock(); var repository = new RepositoryMock(provider); var record = new TesteEntity() { LastChangeDate = DateTime.UtcNow, RegisterDate = DateTime.UtcNow, Id = Guid.NewGuid(), Status = RecordStatus.Active }; var result = repository.UpdateData(record, e => e.Id == record.Id); Assert.Single(result.Where(i => i.MessageType == "RecordNotFoundException")); }