Ejemplo n.º 1
0
        public void TestValidateHavingChildrenWithEmptyChildren()
        {
            // Arrange
            var header = new Header {
                Name = "Parent", Depth = -1, From = 0, To = 4, Children = new List <Header>()
            };

            // Act
            HeaderValidator.ValidateHavingChildren(header);
        }
Ejemplo n.º 2
0
        public void TestValidateHavingChildrenWithInvalidChildCount()
        {
            // Arrange
            var header = new Header {
                Name = "Parent", Depth = -1, From = 0, To = 4, Children =
                    new List <Header> {
                    new Header(),
                }
            };

            // Act
            HeaderValidator.ValidateHavingChildren(header, 2);
        }
Ejemplo n.º 3
0
        public void TestValidateHttpRequest()
        {
            // Arrange
            var header = new Header {
                Name = "HttpRequest Actual", Depth = 1, From = 1, To = 7, Children =
                    new List <Header> {
                    new Header {
                        Depth = 2, From = 1, To = 1, Name = "BaseUri"
                    },
                    new Header {
                        Depth = 2, From = 2, To = 2, Name = "UserAgent"
                    },
                    new Header {
                        Depth = 2, From = 3, To = 3, Name = "PathInfos"
                    },
                    new Header {
                        Depth = 2, From = 4, To = 4, Name = "Fragment"
                    },
                    new Header {
                        Depth = 2, From = 5, To = 5, Name = "Headers", Children =
                            new List <Header> {
                            new Header {
                                Depth = 3, From = 5, To = 5, Name = "Cache"
                            }
                        }
                    },
                    new Header {
                        Depth = 2, From = 6, To = 6, Name = "Cookies", Children =
                            new List <Header> {
                            new Header {
                                Depth = 3, From = 6, To = 6, Name = "TestCookie"
                            }
                        }
                    },
                    new Header {
                        Depth = 2, From = 7, To = 7, Name = "QueryStrings", Children =
                            new List <Header> {
                            new Header {
                                Depth = 3, From = 7, To = 7, Name = "TestQuery"
                            }
                        }
                    },
                },
            };

            // Act
            HeaderValidator.ValidateHavingChildren(header);
        }