public void DataRepositoryTest () { var modelContext = new TestModelContext (); modelContext.Query<TestEntity> ().ToList (); modelContext.Dispose (); // repository call after dispose should throw exception Assert.Throws (typeof (InvalidOperationException), () => modelContext.Query<TestEntity> ().ToList ()); }
public void DataRepositoryTest() { var modelContext = new TestModelContext(); modelContext.Query <TestEntity> ().ToList(); modelContext.Dispose(); // repository call after dispose should throw exception Assert.Throws(typeof(InvalidOperationException), () => modelContext.Query <TestEntity> ().ToList()); }