Beispiel #1
0
 public static ISchemaBuilderStep <EntitySchema, TProviderFilter> NewSchema <TProviderFilter>(
     this IHiveManager hiveManager,
     string alias,
     string name = null)
     where TProviderFilter : class, IProviderTypeFilter
 {
     return(hiveManager.NewSchema <EntitySchema, TProviderFilter>(alias, name));
 }
Beispiel #2
0
        public void SchemaBuilder_CanCreateEntitySchema_WithLongTypeAndGroupDefinition()
        {
            var schema = Hive
                         .NewSchema <EntitySchema, IContentStore>("mySchema")
                         .Define("title", new AttributeType("textbox", "Text box", "who cares", new StringSerializationType()), new AttributeGroup("tab1", "tab1", 0))
                         .Commit();

            if (schema.Errors.Any())
            {
                Assert.Fail(schema.Errors.FirstOrDefault().ToString());
            }

            Assert.True(schema.Success);
            Assert.NotNull(schema.Item);

            ClearCaches();
            var schemaReloaded = AssertSchemaPartExists <EntitySchema, IContentStore>(Hive, schema.Item.Id);

            Assert.That(schemaReloaded.AttributeDefinitions.Any());
            Assert.That(schemaReloaded.AttributeDefinitions[0].Alias, Is.EqualTo("title"));
        }