Пример #1
0
        public void EntityCreatedTest2([DataSources(false)] string configString)
        {
            using (var db = new EntityCreatedDataContext(configString))
            {
                var list = db.Child.Select(c => new { c, c.Parent, a = new { c } }).Take(1).ToList();

                Assert.That(db.EntitiesCreated, Is.EqualTo(2));
            }
        }
Пример #2
0
        public void EntityCreatedTest1([DataSources(false)] string configString)
        {
            using (var db = new EntityCreatedDataContext(configString))
            {
                var list = db.Parent.Take(5).ToList();

                Assert.That(db.EntitiesCreated, Is.EqualTo(5));
            }
        }
Пример #3
0
        public void EntityCreatedTest3([DataSources(false)] string configString, [Values(false, true)] bool checkEntityIdentity)
        {
            using (var db = new EntityCreatedDataContext(configString)
            {
                CheckEntityIdentity = checkEntityIdentity
            })
            {
                var list = db.Child.Where(c => c.Parent.ParentID == 3).Select(c => c.Parent).ToList();

                Assert.That(db.EntitiesCreated, Is.EqualTo(checkEntityIdentity ? 1 : 3));
            }
        }