public void Test_AttachedProperty() { var type = GetTypeDef <AttachedTestClass>(); var list = AttachedEntitiesHelper.GetAttachedEntities(type); Assert.AreEqual(3, list.Count()); }
public void Test_NoEntities() { var type = GetTypeDef <AttachedTestClassNoAttachedEntities>(); var list = AttachedEntitiesHelper.GetAttachedEntities(type); Assert.IsFalse(list.Any()); }
public void Test_AttachedProperty_Property() { var type = GetTypeDef <AttachedPropertyTestClass>(); Assert.AreEqual(1, type.Properties.Count(t => t.Name == "AttributeAttachProperty")); var list = AttachedEntitiesHelper.GetAttachedEntities(type); Assert.AreEqual("AttributeAttach", list.FirstOrDefault(t => t.Name == "AttributeAttach").Name); }
public void Test_AttachedProperty_Formatter_SetOnly() { string expected = "see SetSomeSet"; var type = GetTypeDef <AttachedTestClass>(); var list = AttachedEntitiesHelper.GetAttachedEntities(type); MemberFormatter formatter = new CSharpMemberFormatter(); string def = formatter.GetDeclaration(list.Skip(2).First()); Assert.AreEqual(expected, def); }