Beispiel #1
0
        public void GetCspMixedContentConfigCloned_NoDirective_ReturnsNull()
        {
            var config = new CspConfiguration(false);
            var mapper = new CspConfigMapper();

            var clone = mapper.GetCspMixedContentConfigCloned(config);

            Assert.Null(clone);
        }
Beispiel #2
0
        public void GetCspMixedContentConfigCloned_Configured_ClonesDirective(bool enabled)
        {
            var directive = new CspMixedContentDirectiveConfiguration {
                Enabled = enabled
            };
            var cspConfig = new CspConfiguration(false)
            {
                MixedContentDirective = directive
            };

            var mapper = new CspConfigMapper();

            var result = mapper.GetCspMixedContentConfigCloned(cspConfig);

            Assert.NotNull(result);
            Assert.NotSame(directive, result);
            Assert.Equal(directive.Enabled, result.Enabled);
        }