public void Called_FilterEnabled()
        {
            //Arrange
            XssProtectionOptionsBuilder builder = new XssProtectionOptionsBuilder();

            //Act
            builder.EnableFilter();

            //Assert
            XssProtectionOptions result = builder.Build();

            Assert.True(result.FilterEnabled);
        }
Exemple #2
0
        public void Called_FilterEnabledAndBlockModeSet()
        {
            //Arrange
            XssProtectionOptionsBuilder builder = new XssProtectionOptionsBuilder();

            //Act
            builder.Block();

            //Assert
            XssProtectionOptions result = builder.Build();

            Assert.True(result.FilterEnabled);
            Assert.Equal(XssProtectionMode.Block, result.Mode);
        }
Exemple #3
0
        public void Called_FilterEnabledAndReportSet()
        {
            //Arrange
            XssProtectionOptionsBuilder builder = new XssProtectionOptionsBuilder();
            string reportUri = "https://example.com/some-route";

            //Act
            builder.ReportTo(reportUri);

            //Assert
            XssProtectionOptions result = builder.Build();

            Assert.True(result.FilterEnabled);
            Assert.Equal(XssProtectionMode.Report, result.Mode);
            Assert.Equal(reportUri, result.ReportUri);
        }