public void It_disallows_empty_connection_strings() { var options = new DbContextOptions(); Assert.Equal( Strings.FormatArgumentIsEmpty("connectionString"), Assert.Throws <ArgumentException>(() => AtsDbContextExtensions.UseAzureTableStorage(options, "")).Message ); }
public void It_disallows_empty_account_creds(string name, string key, string paramName) { var options = new DbContextOptions(); Assert.Equal( Strings.FormatArgumentIsEmpty(paramName), Assert.Throws <ArgumentException>(() => AtsDbContextExtensions.UseAzureTableStorage(options, name, key)).Message ); }
public void It_sets_batching_options() { var options = new DbContextOptions(); AtsDbContextExtensions.UseAzureTableStorage(options, "not empty", true); var result = GetAtsExtension(options); Assert.NotNull(result); Assert.True(result.UseBatching); }
public void It_constructs_connection_string() { var options = new DbContextOptions(); AtsDbContextExtensions.UseAzureTableStorage(options, "Moria", "mellon"); var result = GetAtsExtension(options); Assert.NotNull(result); Assert.Equal("DefaultEndpointsProtocol=https;AccountName=Moria;AccountKey=mellon;", result.ConnectionString); }
public void It_passes_through_connection_settings() { var options = new DbContextOptions(); var connectionString = "Speak friend and enter"; AtsDbContextExtensions.UseAzureTableStorage(options, connectionString, false); var result = GetAtsExtension(options); Assert.NotNull(result); Assert.Equal(connectionString, result.ConnectionString); Assert.False(result.UseBatching); }