public void BindTheSessionToTheCurrentSessionContext() { IsolateRepository(); RepositoryFixture.CreateInMemorySqLiteRepository <TestMapping>("Test"); Isolate.Verify.WasCalledWithAnyArguments(() => CurrentSessionContext.Bind(_session)); }
public void PassTheConnectionToTheGetSessionMethodOfTheSessionFactory() { IsolateRepository(); RepositoryFixture.CreateInMemorySqLiteRepository <TestMapping>("Test"); Isolate.Verify.WasCalledWithExactArguments(() => _factory.OpenSession(_connection)); }
public void UseTheReturnedEnvironmentConfigToGetTheSessionFactory() { IsolateRepository(); RepositoryFixture.CreateInMemorySqLiteRepository <TestMapping>("Test"); Isolate.Verify.WasCalledWithAnyArguments(() => _envConfig.GetSessionFactory()); }
public void Init() { InitCache(); _confMan = ConfigurationManager.Instance; Isolate.WhenCalled(() => _confMan.AddInMemorySqLiteEnvironment <TestMapping>("Test")).CallOriginal(); RepositoryFixture.CreateInMemorySqLiteRepository <TestMapping>("Test"); }
public void ThatEntityCanBeIdentifiedByAnId() { var repos = RepositoryFixture.CreateInMemorySqLiteRepository <TestMapping>("test"); var ent = EntityFixture.CreateIntIdEntity(); repos.Add(ent); Assert.AreEqual(ent, repos.First(e => e.Id.Equals(ent.Id))); }
public void ThatEntityCanBeIdentitiedByItsIdentiy() { var ent = EntityFixture.CreateEntityWithId(1); ent.Name = "TestEntity"; var repos = RepositoryFixture.CreateInMemorySqLiteRepository <TestMapping>("test"); repos.Add(ent); Assert.AreEqual(ent, repos.SingleOrDefault(e => e.IsIdentical(ent))); }