Esempio n. 1
0
        public void Called_DenyOptionSet()
        {
            //Arrange
            FrameOptionsOptionsBuilder builder = new FrameOptionsOptionsBuilder();

            //Act
            builder.Deny();

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

            Assert.Equal(FrameOption.Deny, result.Option);
        }
Esempio n. 2
0
        public void Called_SameOriginOptionSet()
        {
            //Arrange
            FrameOptionsOptionsBuilder builder = new FrameOptionsOptionsBuilder();

            //Act
            builder.SameOrigin();

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

            Assert.Equal(FrameOption.SameOrigin, result.Option);
        }
        public void Called_DomainOptionSet()
        {
            //Arrange
            FrameOptionsOptionsBuilder builder = new FrameOptionsOptionsBuilder();
            string domain = "example.com";

            //Act
            builder.AllowFrom(domain);

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

            Assert.Equal(FrameOption.AllowFromDomain, result.Option);
            Assert.Equal(domain, result.AllowedDomain);
        }