示例#1
0
        private IConnectionStringProvider CreateMockProvider(string connectionString)
        {
            Contract.RequiresNotNullOrEmpty(connectionString);
            var mockProvider = new TestConnectionStringProvider(connectionString);

            return(mockProvider);
        }
        public static TestClient GetTestClient(string connectionString, TestNowProvider nowProvider)
        {
            var connectionStringProvider = new TestConnectionStringProvider(connectionString);
            var testServer = TestServerBuilder.CreateServer <TestStartup>(connectionStringProvider, nowProvider);

            return(new TestClient(testServer.CreateClient()));
        }
示例#3
0
        public virtual void TestInitialize()
        {
            LifetimeScope = Container.InternalContainer.BeginLifetimeScope();
            if (IsTransactional)
            {
                TransactionScope = new TransactionScope(TransactionScopeOption.RequiresNew);
            }

            string connectionString = new TestConnectionStringProvider().GetConnectionString();

            Connection = new SqlConnection(connectionString);
            Connection.Open();
        }
        private IConnectionStringProvider CreateFailingProvider(string errorMessage)
        {
            var mockProvider = new TestConnectionStringProvider(errorMessage);

            return(mockProvider);
        }
        private IConnectionStringProvider CreateMockProvider(string connectionString)
        {
            var mockProvider = new TestConnectionStringProvider(connectionString);

            return(mockProvider);
        }