Пример #1
0
        public void ApplyChanges_Test()
        {
            // Act
            var    target = new ListRepository();
            Entity item   = target.GetAll().First();

            // Assert
            target.Modify(item);
        }
Пример #2
0
        public void DeleteTest()
        {
            // Act
            var target = new ListRepository();

            // Act
            IEnumerable <Entity> result = target.GetAll();

            Entity firstEntity = result.First();

            target.Remove(firstEntity);

            IEnumerable <Entity> postResult = target.GetAll();

            // Assert
            Assert.IsNotNull(postResult);
            Assert.IsFalse(postResult.Contains(firstEntity));
        }
Пример #3
0
        public void GetAllTest()
        {
            // Act
            var target = new ListRepository();

            // Act
            IEnumerable <Entity> result = target.GetAll();

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count() == 1);
        }
Пример #4
0
        public void AddTest()
        {
            // Act
            var target = new ListRepository();
            var entity = new Entity
            {
                Id             = 4,
                SampleProperty = "Sample 4"
            };

            // Act
            target.Add(entity);
            IEnumerable <Entity> result = target.GetAll();

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count() == 2);
            Assert.IsTrue(result.Contains(entity));
        }