public void NonExistingSection(string nonExistingSection) { var configuration = CreateConfiguration(); Action act = () => RavenDbSettings.FromConfiguration(configuration, nonExistingSection); act.Should().Throw <InvalidConfigurationException>() .Which.ShouldBeWrittenTo(Output); }
public void InvalidSectionName(string invalidSectionName) { var configuration = CreateConfiguration(); Action act = () => RavenDbSettings.FromConfiguration(configuration, invalidSectionName); act.Should().Throw <ArgumentException>() .Which.ShouldBeWrittenTo(Output); }
private void ConfigureDIContainer() { var store = RavenDbSettings.FromConfiguration(Configuration) .InitializeConnection(_logger); _container.RegisterStoreAndSessionWithContainer(store) .RegisterMigrationEngine(store) .RunMigrations(_logger); _container.RegisterLogging(); }
public static void LoadDefaultConfiguration(string sectionName, string serverUrl, string databaseName) { var configuration = CreateConfiguration(sectionName, serverUrl, databaseName); var ravenDbSettings = RavenDbSettings.FromConfiguration(configuration, sectionName); var expectedSettings = new RavenDbSettings { ServerUrls = new List <string> { serverUrl }, DatabaseName = databaseName }; ravenDbSettings.Should().BeEquivalentTo(expectedSettings); }
public static void LoadCustomSettings(string sectionName, string serverUrl, string databaseName, int otherValue) { var configuration = CreateConfiguration(sectionName, serverUrl, databaseName, new KeyValuePair <string, string>($"{sectionName}:otherValue", otherValue.ToString())); var customSettings = RavenDbSettings.FromConfiguration <CustomRavenDbSettings>(configuration, sectionName); var expectedSettings = new CustomRavenDbSettings { ServerUrls = new List <string> { serverUrl }, DatabaseName = databaseName, OtherValue = otherValue }; customSettings.Should().BeEquivalentTo(expectedSettings); }