예제 #1
0
        public void TestParseWithNullData()
        {
            // Arrange
            var header = new Header {
                Name = "Root", Depth = -1, From = 0, To = 2, Children =
                    new List <Header> {
                    new Header {
                        Name = "Arrange", Depth = 0, From = 1, To = 1, Children =
                            new List <Header> {
                            new Header {
                                Name = "HttpRequest Actual", Depth = 1, From = 1, To = 1, Children =
                                    new List <Header> {
                                    new Header {
                                        Name = "BaseUri", Depth = 2, From = 1, To = 1,
                                    },
                                }
                            }
                        }
                    },
                    new Header {
                        Name = "Assertion", Depth = 0, From = 2, To = 2, Children =
                            new List <Header> {
                            new Header {
                                Name = "Uri", Depth = 1, From = 2, To = 2,
                            },
                        }
                    }
                }
            };

            // Act
            TestCaseParser.Parse(header, null, null);
        }
예제 #2
0
        public void TestParseWithNullRootHeader()
        {
            // Arrange
            var data = new List <List <string> >
            {
                new List <string> {
                    "test case 1", "BaseUri", "/local"
                }
            };

            // Act
            TestCaseParser.Parse(null, data, null);
        }
예제 #3
0
        public void TestParse()
        {
            // Arrange
            var header = new Header {
                Name = "Root", Depth = -1, From = 0, To = 2, Children =
                    new List <Header> {
                    new Header {
                        Name = "Arrange", Depth = 0, From = 1, To = 1, Children =
                            new List <Header> {
                            new Header {
                                Name = "HttpRequest Actual", Depth = 1, From = 1, To = 1, Children =
                                    new List <Header> {
                                    new Header {
                                        Name = "BaseUri", Depth = 2, From = 1, To = 1,
                                    },
                                }
                            }
                        }
                    },
                    new Header {
                        Name = "Assertion", Depth = 0, From = 2, To = 2, Children =
                            new List <Header> {
                            new Header {
                                Name = "Uri", Depth = 1, From = 2, To = 2,
                            },
                        }
                    }
                }
            };


            var data = new List <List <string> >
            {
                new List <string> {
                    "test case 1", "BaseUri", "/local"
                }
            };

            // Act
            var result = TestCaseParser.Parse(header, data, null);

            // Assert
            Assert.AreEqual("test case 1", result.Name);
            Assert.AreEqual(1, result.Assertions.Count);
        }