示例#1
0
 public void SimpleConfiguration_AuthKeyIsNull_ThrowsArgumentException()
 {
     // Act and Assert
     Should.Throw <ArgumentException>(() =>
     {
         DocumentDbProvider.Configure(TestConfig.ValidEndpoint, null);
     });
 }
示例#2
0
 public void FullConfiguration_ConfigIsNull_ThrowsAgurmentNullException()
 {
     // Act and Assert
     Should.Throw <ArgumentNullException>(() =>
     {
         DocumentDbProvider.Configure(null);
     });
 }
        protected void ConfigureProvider(bool autoCreateDbAndCollection = false, bool autoCreateToggle = false)
        {
            var config = TestConfig.ValidConfig(databaseId, collectionId);

            config.AutoCreateDatabaseAndCollection = autoCreateDbAndCollection;
            config.AutoCreateFeature = autoCreateToggle;

            DocumentDbProvider.Configure(config);
        }
示例#4
0
        public void SimpleConfiguration_ValidEndpointAndAuthKeyToggleDoesNotExist_ThrowsToggleConfigurationError()
        {
            // Arrange
            DocumentDbProvider.Configure(TestConfig.ValidEndpoint, TestConfig.ValidAuthKey);

            // Act and Assert
            Should.Throw <ToggleConfigurationError>(() =>
            {
                var toggleValue = sut.EvaluateBooleanToggleValue(new TestFeatureToggle());
            });
        }
示例#5
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            //TableStorageProvider.Configure("UseDevelopmentStorage=true");
            TableStorageProvider.Configure(new TableStorageConfiguration
            {
                ConnectionString  = "UseDevelopmentStorage=true",
                AutoCreateFeature = true,
                AutoCreateTable   = true
            });

            //DocumentDbProvider.Configure("https://localhost:8081", "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==");
            DocumentDbProvider.Configure(new DocumentDbConfiguration
            {
                ServiceEndpoint = "https://localhost:8081",
                AuthKey         = "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
                AutoCreateDatabaseAndCollection = true,
                AutoCreateFeature = true
            });
        }
 public ObligationRepository(IConfiguration configuration)
 {
     _provider = new DocumentDbProvider(new ConnectionSettings(configuration));
 }
示例#7
0
 public void Setup()
 {
     sut = new DocumentDbProvider();
 }
 protected DocumentDbToggle()
 {
     ToggleValueProvider = new DocumentDbProvider();
 }