public void AddFunction_should_uniquify_name() { var database = new EdmModel(DataSpace.SSpace); database.AddFunction("F", new EdmFunctionPayload()); var function = database.AddFunction("F", new EdmFunctionPayload()); Assert.True(database.Functions.Contains(function)); Assert.Equal("F1", database.Functions.Last().Name); }
public void AddFunction_should_create_and_add_function_to_model() { var database = new EdmModel(DataSpace.SSpace); var function = database.AddFunction("F", new EdmFunctionPayload()); Assert.True(database.Functions.Contains(function)); Assert.Equal("F", database.Functions.First().Name); }
public void Configure_should_configure_default_schema_on_functions() { var modelConfiguration = new ModelConfiguration { DefaultSchema = "foo" }; var databaseMetadata = new EdmModel(DataSpace.SSpace); databaseMetadata.AddFunction("F", new EdmFunctionPayload()); var databaseMapping = new DbDatabaseMapping().Initialize( new EdmModel(DataSpace.CSpace), databaseMetadata); modelConfiguration.Configure(databaseMapping, ProviderRegistry.Sql2008_ProviderManifest); Assert.Equal("foo", databaseMapping.Database.Functions.Single().Schema); }