コード例 #1
0
        public void GetAttributeOnInstace_ParentDecoratedWithInheritableAttribute_NoInheritance_Null()
        {
            var inheritor = new ParentDecoratedWithCategoryAndDecription();

            Assert.That(inheritor.GetAttribute <CategoryAttribute>(), Is.Null);
            Assert.That(inheritor.GetAttribute <CategoryAttribute>(false), Is.Null);
        }
コード例 #2
0
        public void GetAttributeOnInstace_ParentDecoratedWithInheritableAttribute_Inheritance_Instance()
        {
            var inheritor = new ParentDecoratedWithCategoryAndDecription();

            Assert.That(inheritor.GetAttribute <CategoryAttribute>(true), Is.InstanceOf <CategoryAttribute>()
                        .With.Property("Name").EqualTo("cat"));
        }
コード例 #3
0
        public void GetAttributesOnInstace_ParentDecoratedWithInheritableAttribute_Inheritance_Instance()
        {
            var inheritor = new ParentDecoratedWithCategoryAndDecription();

            Assert.That(inheritor.GetAttributes <CategoryAttribute>(true), Has.Length.EqualTo(1).And
                        .All.InstanceOf <CategoryAttribute>());
        }
コード例 #4
0
        public void HasAttributeOnInstace_ParentNotDecoratedWithAttribute_False()
        {
            var inheritor = new ParentDecoratedWithCategoryAndDecription();

            Assert.That(inheritor.HasAttribute <TestAttribute>(true), Is.False);
        }
コード例 #5
0
        public void HasAttributeOnInstace_ParentDecoratedWithNonInheritableAttribute_Inheritance_False()
        {
            var inheritor = new ParentDecoratedWithCategoryAndDecription();

            Assert.That(inheritor.HasAttribute <DescriptionAttribute>(true), Is.False);
        }
コード例 #6
0
        public void GetAttributesOnInstace_ParentNotDecoratedWithAttribute_Empty()
        {
            var inheritor = new ParentDecoratedWithCategoryAndDecription();

            Assert.That(inheritor.GetAttributes <TestAttribute>(true), Is.Empty);
        }
コード例 #7
0
        public void GetAttributesOnInstace_ParentDecoratedWithNonInheritableAttribute_Inheritance_Empty()
        {
            var inheritor = new ParentDecoratedWithCategoryAndDecription();

            Assert.That(inheritor.GetAttributes <DescriptionAttribute>(true), Is.Empty);
        }