コード例 #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);
        }
コード例 #2
0
        public void Configure_AttributeHasContentTypeAlias_ContentTypeAliasSetOnConfig()
        {
            //Assign
            var attr = new UmbracoTypeAttribute();
            var type = typeof(StubClass);

            var contentTypeAliasExpected = "test";

            attr.ContentTypeAlias = contentTypeAliasExpected;

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

            //Assert
            config.Type.ShouldBeEquivalentTo(type);
            config.ContentTypeAlias.ShouldBeEquivalentTo(contentTypeAliasExpected);
        }
コード例 #3
0
        public void Configure_AttributeHasContentTypeName_ContentTypeNameSetOnConfig()
        {
            //Assign
            var attr = new UmbracoTypeAttribute();
            var config = new UmbracoTypeConfiguration();
            var type = typeof(StubClass);

            var contentTypeNameExpected = "test";

            attr.ContentTypeName = contentTypeNameExpected;

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

            //Assert
            config.Type.ShouldBeEquivalentTo(type);
            config.ContentTypeName.ShouldBeEquivalentTo(contentTypeNameExpected);
        }