示例#1
0
        public override bool Equals(object obj)
        {
            SettingsBindableAttribute other =
                obj as SettingsBindableAttribute;

            return(other != null && bindable == other.bindable);
        }
        public void Ctor_Bool(bool bindable)
        {
            var attribute = new SettingsBindableAttribute(bindable);

            Assert.Equal(bindable, attribute.Bindable);
            Assert.False(attribute.IsDefaultAttribute());
        }
 public void Equals_Object_ReturnsExpected(SettingsBindableAttribute attribute, object other, bool expected)
 {
     Assert.Equal(expected, attribute.Equals(other));
     if (other is SettingsBindableAttribute)
     {
         Assert.Equal(expected, attribute.GetHashCode().Equals(other.GetHashCode()));
     }
 }
        public void No_Get_ReturnsExpected()
        {
            SettingsBindableAttribute attribute = SettingsBindableAttribute.No;

            Assert.Same(attribute, SettingsBindableAttribute.No);
            Assert.False(attribute.Bindable);
            Assert.False(attribute.IsDefaultAttribute());
        }
        public static IEnumerable <object[]> Equals_TestData()
        {
            var attribute = new SettingsBindableAttribute(true);

            yield return(new object[] { attribute, attribute, true });

            yield return(new object[] { attribute, new SettingsBindableAttribute(true), true });

            yield return(new object[] { attribute, new SettingsBindableAttribute(false), false });

            yield return(new object[] { new SettingsBindableAttribute(false), new SettingsBindableAttribute(false), true });

            yield return(new object[] { new SettingsBindableAttribute(false), new SettingsBindableAttribute(true), false });

            yield return(new object[] { attribute, new object(), false });

            yield return(new object[] { attribute, null, false });
        }