Beispiel #1
0
        public void MergeAttributes_FirstArgumentNull()
        {
            var injectedAllowedTypesAttribute = new InjectedAllowedTypesAttribute(_contentLoader)
            {
                AllowedTypes = new[] { typeof(DifferentPage) }
            };

            var result = InjectedAllowedTypes.MergeAttributes(null, injectedAllowedTypesAttribute);

            result.AllowedTypes.ShouldBe(new[] { typeof(DifferentPage) });
        }
Beispiel #2
0
        public void MergeAttributes_SecondArgumentNull()
        {
            var allowedTypesAttribute = new AllowedTypesAttribute
            {
                AllowedTypes = new[] { typeof(StandardPage) }
            };

            var result = InjectedAllowedTypes.MergeAttributes(allowedTypesAttribute, null);

            result.AllowedTypes.ShouldBe(new[] { typeof(StandardPage) });
        }
Beispiel #3
0
        public void MergeAttributes_ShouldContainBothSpecifiedAndInjectedAttribute_Distinct()
        {
            var allowedTypesAttribute = new AllowedTypesAttribute
            {
                AllowedTypes = new[] { typeof(StandardPage) }
            };

            var injectedAllowedTypesAttribute = new InjectedAllowedTypesAttribute(_contentLoader)
            {
                AllowedTypes = new[] { typeof(DifferentPage), typeof(StandardPage) }
            };

            var result = InjectedAllowedTypes.MergeAttributes(allowedTypesAttribute, injectedAllowedTypesAttribute);

            result.AllowedTypes.ShouldBe(new[] { typeof(StandardPage), typeof(DifferentPage) });
        }
Beispiel #4
0
        public void MergeAttributes_BothArgumentNull()
        {
            var result = InjectedAllowedTypes.MergeAttributes(null, null);

            result.ShouldBeNull();
        }