コード例 #1
0
        public void TestValidateHttpRequestWithFragmentHavingTwoChildren()
        {
            // Arrange
            var header = new Header
            {
                Name     = "HttpRequest Expected",
                Children = new List <Header>
                {
                    new Header
                    {
                        Name = "BaseUri",
                    },
                    new Header
                    {
                        Name     = "Fragment",
                        Children = new List <Header>
                        {
                            new Header(),
                            new Header(),
                        }
                    }
                }
            };

            // Act
            HeaderValidator.ValidateHttpRequest(header);
        }
コード例 #2
0
        public void TestValidateHttpRequestWithBaseUriHavingChildren()
        {
            // Arrange
            var header = new Header
            {
                Name     = "HttpRequest Expected",
                Children = new List <Header>
                {
                    new Header
                    {
                        Name     = "BaseUri",
                        Children = new List <Header>
                        {
                            new Header
                            {
                                Name = "User-Agent"
                            }
                        }
                    }
                }
            };

            // Act
            HeaderValidator.ValidateHttpRequest(header);
        }
コード例 #3
0
        public void TestValidateHttpRequestWithNotHavingChildren()
        {
            // Arrange
            var header = new Header
            {
                Name = "HttpRequest Expected",
            };

            // Act
            HeaderValidator.ValidateHttpRequest(header);
        }
コード例 #4
0
        public void TestValidateHttpRequestWithInvalidName()
        {
            // Arrange
            var header = new Header
            {
                Name = "HttpRequest aa",
            };

            // Act
            HeaderValidator.ValidateHttpRequest(header);
        }
コード例 #5
0
        public void TestValidateHttpRequestWithNotHavingBaseUri()
        {
            // Arrange
            var header = new Header
            {
                Name     = "HttpRequest Expected",
                Children = new List <Header>
                {
                    new Header
                    {
                        Name = "PathInfos",
                    }
                }
            };

            // Act
            HeaderValidator.ValidateHttpRequest(header);
        }
コード例 #6
0
        public void TestValidateHttpRequestInvalidChildName()
        {
            // Arrange
            var header = new Header
            {
                Name     = "HttpRequest Actual",
                Depth    = 1,
                From     = 1,
                To       = 2,
                Children =
                    new List <Header> {
                    new Header {
                        Depth = 2, From = 1, To = 1, Name = "BaseUri"
                    },
                    new Header {
                        Depth = 2, From = 1, To = 1, Name = "XXXX"
                    },
                }
            };

            // Act
            HeaderValidator.ValidateHttpRequest(header);
        }