public WhenCallingOpenAsyncSession_SpecifyingConnectionScope() { var mockDbDriver = new Mock<IDbDriver>(); mockDbDriver.Setup(x => x.CreateConnection()).Returns(new Mock<IDbConnection>().Object); var mockSqlDialect = new Mock<ISqlDialect>(); mockSqlDialect.Setup(x => x.SqlCharacters).Returns(this.sqlCharacters); var sessionFactory = new SessionFactory("SqlConnection", mockDbDriver.Object, mockSqlDialect.Object); this.session = sessionFactory.OpenAsyncSession(ConnectionScope.PerSession); }
public WhenCallingOpenAsyncSession_MultipleTimes() { var sessionFactory = new SessionFactory("SqlConnection", new Mock<IDbDriver>().Object, new Mock<ISqlDialect>().Object); this.session1 = sessionFactory.OpenAsyncSession(); this.session2 = sessionFactory.OpenAsyncSession(); }