Exemple #1
0
        public void Configure_ConfigurationIsOfCorrectType_NoExceptionThrown()
        {
            //Assign
            var attr = new UmbracoTypeAttribute();
            var type = typeof(StubClass);

            //Act
            var config = attr.Configure(type);

            //Assert
            config.Type.ShouldBeEquivalentTo(type);
        }
Exemple #2
0
        public void Configure_AttributeHasContentTypeName_ContentTypeNameSetOnConfig()
        {
            //Assign
            var attr = new UmbracoTypeAttribute();
            var type = typeof(StubClass);

            var contentTypeNameExpected = "test";

            attr.ContentTypeName = contentTypeNameExpected;

            //Act
            var config = attr.Configure(type) as UmbracoTypeConfiguration;

            //Assert
            config.Type.ShouldBeEquivalentTo(type);
            config.ContentTypeName.ShouldBeEquivalentTo(contentTypeNameExpected);
        }
Exemple #3
0
        public void Configure_AttributeHasContentTypeAlias_ContentTypeAliasSetOnConfig()
        {
            //Assign
            var attr   = new UmbracoTypeAttribute();
            var config = new UmbracoTypeConfiguration();
            var type   = typeof(StubClass);

            var contentTypeAliasExpected = "test";

            attr.ContentTypeAlias = contentTypeAliasExpected;

            //Act
            attr.Configure(type, config);

            //Assert
            config.Type.ShouldBeEquivalentTo(type);
            config.ContentTypeAlias.ShouldBeEquivalentTo(contentTypeAliasExpected);
        }