Пример #1
0
        public ValidationRuleFailureTest()
        {
            RouteSegment segment = RouteSegmentFactory.MakeDoublePoint();

            definition = segment.GetDefinition();
            rule       = new ValidationRuleFailure("just because", segment);
        }
Пример #2
0
        public void TestItFailsOnBadNdb()
        {
            List <RouteSegment> segments = new()
            {
                RouteSegmentFactory.MakeDoublePoint("testvor", "testndb"),
                RouteSegmentFactory.MakeDoublePoint("testndb", "testairport"),
                RouteSegmentFactory.MakePointCoordinate("testairport"),
                RouteSegmentFactory.MakeCoordinatePoint("testfix"),
            };

            SidStarRoute route = new(
                SidStarType.STAR,
                "EGKK TEST",
                RouteSegmentFactory.MakeDoublePoint("testfix", "testvor"),
                segments,
                DefinitionFactory.Make(),
                DocblockFactory.Make(),
                CommentFactory.Make()
                );

            sectorElements.Add(route);
            sectorElements.Ndbs.Clear();

            AssertValidationErrors(2);
        }
        public void TestItFailsOnInvalidDefinedColoursAfterLooping()
        {
            sectorElements.Add(
                SidStarRouteFactory.Make(
                    segments: new List <RouteSegment>
            {
                RouteSegmentFactory.MakeDoublePoint(colour: "colour1"),
                RouteSegmentFactory.MakeDoublePoint(colour: "colour1"),
                RouteSegmentFactory.MakeDoublePoint(colour: "colour2"),
            }
                    )
                );

            AssertValidationErrors();
        }
        public void TestItPassesOnValidDefinedColours()
        {
            sectorElements.Add(
                SidStarRouteFactory.Make(
                    segments: new List <RouteSegment>
            {
                RouteSegmentFactory.MakeDoublePoint(colour: "colour1"),
                RouteSegmentFactory.MakeDoublePoint(colour: "colour1"),
                RouteSegmentFactory.MakeDoublePoint(colour: "colour1"),
            }
                    )
                );

            AssertNoValidationErrors();
        }
        public void TestItFailsOnInvalidColourIntegers()
        {
            sectorElements.Add(
                SidStarRouteFactory.Make(
                    segments: new List <RouteSegment>
            {
                RouteSegmentFactory.MakeDoublePoint(colour: "255"),
                RouteSegmentFactory.MakeDoublePoint(colour: "-1"),
                RouteSegmentFactory.MakeDoublePoint(colour: "255"),
            }
                    )
                );

            AssertValidationErrors();
        }
        public void TestItPassesOnValidColoursIntegers()
        {
            sectorElements.Add(
                SidStarRouteFactory.Make(
                    SidStarType.STAR,
                    new List <RouteSegment>
            {
                RouteSegmentFactory.MakeDoublePoint(colour: "255"),
                RouteSegmentFactory.MakeDoublePoint(colour: "266"),
                RouteSegmentFactory.MakeDoublePoint(colour: "266"),
            }
                    )
                );

            AssertNoValidationErrors();
        }
Пример #7
0
        public void TestItPassesOnValidRoute()
        {
            sectorElements.Add(
                SidStarRouteFactory.Make(
                    segments: new List <RouteSegment>
            {
                RouteSegmentFactory.MakeDoublePoint("testfix", "testvor"),
                RouteSegmentFactory.MakeDoublePoint("testvor", "testndb"),
                RouteSegmentFactory.MakeDoublePoint("testndb", "testairport"),
                RouteSegmentFactory.MakePointCoordinate("testairport", new Coordinate("abc", "def")),
                RouteSegmentFactory.MakeCoordinatePoint("testvor", new Coordinate("abc", "def")),
            }
                    )
                );

            AssertNoValidationErrors();
        }
Пример #8
0
        public void TestItFailsOnBadFix()
        {
            sectorElements.Add(
                SidStarRouteFactory.Make(
                    segments: new List <RouteSegment>
            {
                RouteSegmentFactory.MakeDoublePoint("testfix", "testvor"),
                RouteSegmentFactory.MakeDoublePoint("testvor", "testndb"),
                RouteSegmentFactory.MakeDoublePoint("testndb", "testairport"),
                RouteSegmentFactory.MakePointCoordinate("testairport", new Coordinate("abc", "def")),
                RouteSegmentFactory.MakeCoordinatePoint("testfix", new Coordinate("abc", "def")),
            }
                    )
                );

            sectorElements.Fixes.Clear();
            AssertValidationErrors(2);
        }