Пример #1
0
        public void AppenDataIvalidFieldsTest()
        {
            var provider   = new ProviderMock();
            var repository = new RepositoryMock(provider);

            var result = repository.AppenData(new TesteEntity());

            Assert.True(result.Count(c => c.MessageType.Equals(nameof(FieldValueException))) == 4);
        }
Пример #2
0
        public void AppenDataTest()
        {
            var provider   = new ProviderMock();
            var repository = new RepositoryMock(provider);

            var result = repository.AppenData(new TesteEntity()
            {
                LastChangeDate = DateTime.UtcNow, RegisterDate = DateTime.UtcNow, Id = Guid.NewGuid(), Status = RecordStatus.Active
            });

            Assert.Single(result.Where(i => i.MessageType == "AppendData"));
        }
Пример #3
0
        public void GetDataTest()
        {
            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
            };

            repository.AppenData(record);

            var result = repository.GetData(e => e.Id == record.Id);

            Assert.Single(result);
        }