Beispiel #1
0
        public void CreateCustomersTest()
        {
            // NOTE : Arrange.
            var customer = new TestEntity {
                Name = "Vasya",
            };

            // NOTE : Act.
            customer.Save();
            var customers = TestEntity.DataSource.AsList();

            // NOTE : Assert.
            Assert.NotNull(customers);
            Assert.AreEqual(1, customers.Count);
            Assert.AreEqual(customer.Name, customers[0].Name);
        }
Beispiel #2
0
        public void DeleteTest()
        {
            // NOTE : Arrange.
            var customer = new TestEntity {
                Name = "Vasya",
            };
            customer.Save();

            // NOTE : Act.
            customer.Delete();

            IList<TestEntity> customers = TestEntity.DataSource.AsList();

            // NOTE : Assert.
            Assert.NotNull(customers);
            Assert.AreEqual(0, customers.Count);
        }
Beispiel #3
0
        public void EnumParsingTest()
        {
            // NOTE : Arrange.
            var customer = new TestEntity {
                Name = "Vasya",
                Enum = TestEnum.Three
            };

            // NOTE : Act.
            customer.Save();
            IList<TestEntity> customers = TestEntity.DataSource.AsList();

            // NOTE : Assert.
            Assert.NotNull(customers);
            Assert.AreEqual(1, customers.Count);
            Assert.AreEqual(TestEnum.Three, customers[0].Enum);
        }
Beispiel #4
0
        public void RestrictionLengthTest()
        {
            // NOTE : Arrange.
            string name = "a";
            0.Step(1000, (i) => {
                name += "a";
            });
            var customer = new TestEntity {
                Name = name
            };

            // NOTE : Act.
            customer.Save();
        }