public void Dispose_RemovedDbSets() { // Arrange _mockContext = new MockEfContext(typeof(TestEntity)); // Act _mockContext.Object.Dispose(); // Assert Assert.ThrowsException <NullReferenceException>(() => _mockContext.GetDbSet <TestEntity>(), "The dbset should not exist once the context has been disposed."); }
public void GetDbSet_ForNonExistingType_ThrowsException() { // Assert Assert.ThrowsException <KeyNotFoundException>(() => _mockContext.GetDbSet <string>()); }