public void then_open_connection_is_not_disposed() { var dbConnection = new DbConnectionSpy { State = ConnectionState.Open }; dbConnection.SafeClose(); Assert.IsFalse(dbConnection.DisposeCalled); }
public void then_open_connection_is_disposed_when_requested() { var dbConnection = new DbConnectionSpy { State = ConnectionState.Open }; dbConnection.SafeClose(true); Assert.IsTrue(dbConnection.DisposeCalled); }
public void then_open_connection_is_closed() { var dbConnection = new DbConnectionSpy { State = ConnectionState.Open }; dbConnection.SafeClose(); Assert.IsTrue(dbConnection.CloseCalled); }
public void then_already_closed_connection_is_not_closed() { var dbConnection = new DbConnectionSpy {State = ConnectionState.Closed}; dbConnection.SafeClose(); Assert.IsFalse(dbConnection.CloseCalled); }
public void then_already_closed_connection_is_not_disposed() { var dbConnection = new DbConnectionSpy { State = ConnectionState.Closed }; dbConnection.SafeClose(); Assert.IsFalse(dbConnection.DisposeCalled); }
public void then_already_closed_connection_is_disposed_when_requested() { var dbConnection = new DbConnectionSpy { State = ConnectionState.Closed }; dbConnection.SafeClose(true); Assert.IsTrue(dbConnection.DisposeCalled); }