Exemple #1
0
        protected override void Arrange()
        {
            _transaction = new TransactionScope();

            Factory = Stub <IUsersContextFactory>();

            A.CallTo(() => Factory.CreateContext())
            .Returns(new SqlServerUsersContext());

            SystemUnderTest = new AccessTokenClientRepo(Factory);

            TestFixtureContext = new SqlServerUsersContext();
        }
Exemple #2
0
        protected override void Arrange()
        {
            _transaction = new TransactionScope();
            Factory      = Stub <IUsersContextFactory>();

            var config = new ConfigurationBuilder()
                         .SetBasePath(TestContext.CurrentContext.TestDirectory)
                         .AddJsonFile("appsettings.json", optional: true)
                         .AddEnvironmentVariables()
                         .Build();

            var connectionStringProvider = new ConfigConnectionStringsProvider(config);

            A.CallTo(() => Factory.CreateContext())
            .Returns(new SqlServerUsersContext(connectionStringProvider.GetConnectionString("EdFi_Admin")));

            SystemUnderTest = new AccessTokenClientRepo(Factory, config);

            TestFixtureContext = new SqlServerUsersContext(connectionStringProvider.GetConnectionString("EdFi_Admin"));
        }