public ISession Create(IsolationLevel isolationLevel = IsolationLevel.ReadCommitted)
        {
            var connection  = _connectionsFactory.Create();
            var transaction = connection.BeginTransaction(isolationLevel);

            return(new Session(connection, transaction));
        }
        protected DbUsingTestBase()
        {
            _isAppVeyor = Environment.GetEnvironmentVariable("Appveyor")?.ToUpperInvariant() == "TRUE";

            ConnectionsFactory          = new SqlConnectionsFactory(ConnectionString);
            SqlConnectionsFactoryMethod = () => (SqlConnection)ConnectionsFactory.Create();
        }
Ejemplo n.º 3
0
        protected DbUsingTestBase()
        {
            _isAppVeyor = Environment.GetEnvironmentVariable("Appveyor")?.ToUpperInvariant() == "TRUE";
            _isTravis   = Environment.GetEnvironmentVariable("TRAVIS")?.ToUpperInvariant() == "TRUE";

            ConnectionsFactory = new SqlConnectionsFactory(Options.Create(new SqlConnectionsFactoryOptions {
                SqlServer = ConnectionString
            }));
            SqlConnectionsFactoryMethod = () => (SqlConnection)ConnectionsFactory.Create();
        }
        protected DbUsingTestBase()
        {
            var isAppVeyor = Environment.GetEnvironmentVariable("APPVEYOR")?.ToUpperInvariant() == "TRUE";

            _isAppVeyorWindows = isAppVeyor && Environment.GetEnvironmentVariable("CI_WINDOWS")?.ToUpperInvariant() == "TRUE";
            _isAppVeyorLinux   = isAppVeyor && Environment.GetEnvironmentVariable("CI_LINUX")?.ToUpperInvariant() == "TRUE";

            _isTravis = Environment.GetEnvironmentVariable("TRAVIS")?.ToUpperInvariant() == "TRUE";

            ConnectionsFactory = new SqlConnectionsFactory(Options.Create(new SqlConnectionsFactoryOptions {
                SqlServer = ConnectionString
            }));
            SqlConnectionsFactoryMethod = () => (SqlConnection)ConnectionsFactory.Create();
        }