public void GetCspSandboxConfigCloned_NoDirective_ReturnsNull()
        {
            var config = new CspConfiguration(false);
            var mapper = new CspConfigMapper();

            var clone = mapper.GetCspSandboxConfigCloned(config);

            Assert.IsNull(clone);
        }
        public void GetCspSandboxConfigCloned_Configured_ClonesDirective()
        {
            var firstDirective = new CspSandboxDirectiveConfiguration
            {
                AllowForms = true,
                AllowPointerLock = true,
                AllowPopups = true
            };
            var firstConfig = new CspConfiguration(false) { SandboxDirective = firstDirective };
            var secondDirective = new CspSandboxDirectiveConfiguration()
            {
                AllowSameOrigin = true,
                AllowScripts = true,
                AllowTopNavigation = true,
                Enabled = true
            };
            var secondConfig = new CspConfiguration(false) { SandboxDirective = secondDirective };
            var mapper = new CspConfigMapper();

            var firstResult = mapper.GetCspSandboxConfigCloned(firstConfig);
            var secondResult = mapper.GetCspSandboxConfigCloned(secondConfig);

            Assert.That(firstResult, Is.EqualTo(firstDirective).Using(new CspSandboxDirectiveConfigurationComparer()));
            Assert.That(secondResult, Is.EqualTo(secondDirective).Using(new CspSandboxDirectiveConfigurationComparer()));
        }