コード例 #1
0
        public void GetTraitOptions_ViaAttributeUsage()
        {
            var source = new FakeAttribute();

            var expected = new TraitOptions
            {
                ValidOn       = AttributeTargets.Property,
                AllowMultiple = true,
                Inherited     = false
            };

            AssertTraitOptions(source, expected);
        }
コード例 #2
0
        public void GetTraitOptions_Default()
        {
            var source = new object();

            var expected = new TraitOptions
            {
                ValidOn       = AttributeTargets.All,
                AllowMultiple = false,
                Inherited     = true
            };

            AssertTraitOptions(source, expected);
        }
コード例 #3
0
        public void GetTraitOptions_ViaInterface_OverridingAttributeUsage()
        {
            var source = new MockAnnotationAttribute
            {
                ValidOn       = AttributeTargets.Interface,
                AllowMultiple = true,
                Inherited     = false
            };

            var expected = new TraitOptions
            {
                ValidOn       = AttributeTargets.Interface,
                AllowMultiple = true,
                Inherited     = false
            };

            AssertTraitOptions(source, expected);
        }