Beispiel #1
0
        public void TestDirective()
        {
            var robots = Robots.Empty()
                         .Directive(new string[] { "MyAgent 1", "MyAgent 2" },
                                    new string[] { "/allowed", "/alsoallowed" },
                                    new string[] { "/disallowed/", "/alsodisallowed" });

            using var runner = TestRunner.Run(GetTest(robots));

            var result = GetRobots(runner);

            Assert.Contains("User-agent: MyAgent 1", result);
            Assert.Contains("User-agent: MyAgent 2", result);

            Assert.Contains("Allow: /allowed", result);
            Assert.Contains("Allow: /alsoallowed", result);

            Assert.Contains("Disallow: /disallowed/", result);
            Assert.Contains("Disallow: /alsodisallowed", result);
        }