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)); } }
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)); } }
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)); } }