public void Does_Constructor_Set_Type_NotSet() { //Assign var infoAttribute = new UmbracoInfoAttribute(); //Act //Assert infoAttribute.Type.ShouldBeEquivalentTo(UmbracoInfoType.NotSet); }
public void Configure_ConfigureCalled_UmbracoInfoConfigurationReturned() { //Assign var attr = new UmbracoInfoAttribute(); var propertyInfo = typeof(StubClass).GetProperty("DummyProperty"); //Act var result = attr.Configure(propertyInfo) as UmbracoInfoConfiguration; //Assert result.Should().NotBeNull(); result.Type.ShouldBeEquivalentTo(UmbracoInfoType.NotSet); }
public void Configure_TypeSet_TypeSetOnConfiguration() { //Assign var attr = new UmbracoInfoAttribute(); var propertyInfo = typeof(StubClass).GetProperty("DummyProperty"); attr.Type = UmbracoInfoType.ContentTypeName; //Act var result = attr.Configure(propertyInfo) as UmbracoInfoConfiguration; //Assert result.Should().NotBeNull(); result.Type.ShouldBeEquivalentTo(UmbracoInfoType.ContentTypeName); }
internal void SetupNodeTree <TDocType>(UmbracoInfoAttribute attr) where TDocType : DocTypeBase, new() { var tree = new NodeTree <TDocType>(this); if (!this._trees.ContainsKey(attr)) { lock (lockObject) { this._trees.Add(attr, tree); //cache so it's faster to get next time } } else { this._trees[attr] = tree; } }