public void UseTheReturnedEnvironmentConfigToGetTheSessionFactory() { IsolateRepository(); RepositoryFixture.CreateInMemorySqLiteRepository <TestMapping>("Test"); Isolate.Verify.WasCalledWithAnyArguments(() => _envConfig.GetSessionFactory()); }
private void IsolateRepository() { ObjectFactory.EjectAllInstancesOf <IConnectionCache>(); _envConfig = Isolate.Fake.Instance <IEnvironmentConfiguration>(); Isolate.WhenCalled(() => _confMan.GetConfiguration("Test")).WillReturn(_envConfig); _connection = Isolate.Fake.Instance <IDbConnection>(); Isolate.WhenCalled(() => _envConfig.GetConnection()).WillReturn(_connection); _factory = Isolate.Fake.Instance <ISessionFactory>(); Isolate.WhenCalled(() => _envConfig.GetSessionFactory()).WillReturn(_factory); _session = Isolate.Fake.Instance <ISession>(); Isolate.WhenCalled(() => _factory.OpenSession(_connection)).WillReturn(_session); Isolate.WhenCalled(() => _envConfig.BuildSchema(_session)).IgnoreCall(); Isolate.WhenCalled(() => CurrentSessionContext.Bind(_session)).IgnoreCall(); }
private void IsolateRepository() { ObjectFactory.EjectAllInstancesOf<IConnectionCache>(); _envConfig = Isolate.Fake.Instance<IEnvironmentConfiguration>(); Isolate.WhenCalled(() => _confMan.GetConfiguration("Test")).WillReturn(_envConfig); _connection = Isolate.Fake.Instance<IDbConnection>(); Isolate.WhenCalled(() => _envConfig.GetConnection()).WillReturn(_connection); _factory = Isolate.Fake.Instance<ISessionFactory>(); Isolate.WhenCalled(() => _envConfig.GetSessionFactory()).WillReturn(_factory); _session = Isolate.Fake.Instance<ISession>(); Isolate.WhenCalled(() => _factory.OpenSession(_connection)).WillReturn(_session); Isolate.WhenCalled(() => _envConfig.BuildSchema(_session)).IgnoreCall(); Isolate.WhenCalled(() => CurrentSessionContext.Bind(_session)).IgnoreCall(); }