public void OpenSession_CloseSession() { Assert.AreSame(_mockSession.Object, _dbCtx.NotNullEntityRepository.Session); Assert.AreSame(_mockSession.Object, _dbCtx.NullableEntityRepository.Session); _dbCtx.CloseSession(); Assert.IsNull(_dbCtx.NotNullEntityRepository.Session); Assert.IsNull(_dbCtx.NullableEntityRepository.Session); _mockSession.Verify(m => m.Dispose()); }