public void Ctor_Bool(bool visible)
        {
            var attribute = new DesignTimeVisibleAttribute(visible);

            Assert.Equal(visible, attribute.Visible);
            Assert.Equal(visible, attribute.IsDefaultAttribute());
        }
예제 #2
0
        /// <summary>
        /// Add our designtimevisible attribute to the attributes for the item
        /// </summary>
        /// <param name="attributes"></param>
        protected override void PreFilterAttributes(System.Collections.IDictionary attributes)
        {
            base.PreFilterAttributes(attributes);
            DesignTimeVisibleAttribute att = new DesignTimeVisibleAttribute(((DbCommand)Component).DesignTimeVisible);

            attributes[att.TypeId] = att;
        }
        public void Ctor_Default()
        {
            var attribute = new DesignTimeVisibleAttribute();

            Assert.False(attribute.Visible);
            Assert.False(attribute.IsDefaultAttribute());
        }
 public void Equals_Object_ReturnsExpected(DesignTimeVisibleAttribute attribute, object other, bool expected)
 {
     Assert.Equal(expected, attribute.Equals(other));
     if (other is DesignTimeVisibleAttribute)
     {
         Assert.Equal(expected, attribute.GetHashCode().Equals(other.GetHashCode()));
     }
 }
        public void Default_Get_ReturnsExpected()
        {
            DesignTimeVisibleAttribute attribute = DesignTimeVisibleAttribute.Default;

            Assert.Same(attribute, DesignTimeVisibleAttribute.Default);
            Assert.True(attribute.Visible);
            Assert.True(attribute.IsDefaultAttribute());
        }
        public void No_Get_ReturnsExpected()
        {
            DesignTimeVisibleAttribute attribute = DesignTimeVisibleAttribute.No;

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

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

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

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

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

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

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

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