public void Default_Get_ReturnsExpected() { DefaultBindingPropertyAttribute attribute = DefaultBindingPropertyAttribute.Default; Assert.Same(attribute, DefaultBindingPropertyAttribute.Default); Assert.Null(attribute.Name); }
public void GetHashCodeTest() { DefaultBindingPropertyAttribute a; a = new DefaultBindingPropertyAttribute("test"); Assert.IsFalse(0 == a.GetHashCode(), "1"); }
public Label() { DefaultBindingPropertyAttribute defaultBindingAttribute = (DefaultBindingPropertyAttribute)Attribute.GetCustomAttribute(typeof(Label), typeof(DefaultBindingPropertyAttribute)); if (defaultBindingAttribute != null) { Text = defaultBindingAttribute.Name; } }
public void EqualsTest() { DefaultBindingPropertyAttribute a; a = new DefaultBindingPropertyAttribute("test"); Assert.IsFalse(a.Equals(null), "1"); Assert.IsFalse(a.Equals(new DefaultBindingPropertyAttribute("other")), "2"); Assert.IsFalse(a.Equals(new DefaultBindingPropertyAttribute("Test")), "3"); Assert.IsTrue(a.Equals(new DefaultBindingPropertyAttribute("test")), "4"); }
public void CtorTest() { DefaultBindingPropertyAttribute a; a = new DefaultBindingPropertyAttribute("test"); Assert.AreEqual("test", a.Name, "1"); a = new DefaultBindingPropertyAttribute(); Assert.AreEqual(null, a.Name, "2"); }
public static IEnumerable <object[]> Equals_TestData() { var attribute = new DefaultBindingPropertyAttribute("name"); yield return(new object[] { attribute, attribute, true }); yield return(new object[] { attribute, new DefaultBindingPropertyAttribute("name"), true }); yield return(new object[] { attribute, new DefaultBindingPropertyAttribute("name2"), false }); yield return(new object[] { attribute, new DefaultBindingPropertyAttribute(null), false }); yield return(new object[] { new DefaultBindingPropertyAttribute(null), new DefaultBindingPropertyAttribute(null), true }); yield return(new object[] { new DefaultBindingPropertyAttribute(null), new DefaultBindingPropertyAttribute("name"), false }); yield return(new object[] { new DefaultBindingPropertyAttribute(null), null, false }); yield return(new object[] { attribute, new object(), false }); yield return(new object[] { attribute, null, false }); }
public void DesignerAttributes_DefaultBindingPropertyAttribute_PropertyExists(Type type, DefaultBindingPropertyAttribute attribute) { var propertyInfo = type.GetProperty(attribute.Name); _output.WriteLine($"{type.FullName}: {attribute.Name} --> {propertyInfo?.Name}"); Assert.NotNull(propertyInfo); }
public void GetHashCode_InvokeMultipleTimes_ReturnsEqual() { var attribute = new DefaultBindingPropertyAttribute("name"); Assert.Equal(attribute.GetHashCode(), attribute.GetHashCode()); }
public void Equals_Other_ReturnsExpected(DefaultBindingPropertyAttribute attribute, object other, bool expected) { Assert.Equal(expected, attribute.Equals(other)); }
public void Ctor_Name(string name) { var attribute = new DefaultBindingPropertyAttribute(name); Assert.Equal(name, attribute.Name); }
public void Ctor_Default() { var attribute = new DefaultBindingPropertyAttribute(); Assert.Null(attribute.Name); }