public void TestItPassesOnAllValid(string first, string second, string third)
        {
            sectorElements.Add(
                SectorFactory.Make(
                    arrivalAirports: new List <SectorArrivalAirports>
            {
                SectorArrivalAirportsFactory.Make(new List <string> {
                    first, second
                })
            }
                    )
                );
            sectorElements.Add(
                SectorFactory.Make(
                    arrivalAirports: new List <SectorArrivalAirports>
            {
                SectorArrivalAirportsFactory.Make(new List <string> {
                    second, third
                })
            }
                    )
                );

            AssertNoValidationErrors();
        }
        public void TestItPassesOnValidControllers()
        {
            sectorElements.Add(
                SectorFactory.Make(
                    alternate: new List <SectorAlternateOwnerHierarchy>
            {
                SectorAlternateOwnerHierarchyFactory.Make(new List <string> {
                    "LS", "LC"
                }),
                SectorAlternateOwnerHierarchyFactory.Make(new List <string> {
                    "BBR"
                }),
            }
                    )
                );
            sectorElements.Add(
                SectorFactory.Make(
                    alternate: new List <SectorAlternateOwnerHierarchy>
            {
                SectorAlternateOwnerHierarchyFactory.Make(new List <string> {
                    "LS", "LC"
                }),
                SectorAlternateOwnerHierarchyFactory.Make(new List <string> {
                    "BBR", "LS"
                }),
            }
                    )
                );

            AssertNoValidationErrors();
        }
        public void TestItAddsSectors()
        {
            Sector sector = SectorFactory.Make();

            collection.Add(sector);
            Assert.Equal(sector, collection.Sectors[0]);
        }
        public void TestItFailsOnInvalidControllers(string first, string second, string third, string bad)
        {
            sectorElements.Add(
                SectorFactory.Make(
                    alternate: new List <SectorAlternateOwnerHierarchy>
            {
                SectorAlternateOwnerHierarchyFactory.Make(new List <string> {
                    first, second
                }),
                SectorAlternateOwnerHierarchyFactory.Make(new List <string> {
                    second
                }),
            }
                    )
                );

            sectorElements.Add(
                SectorFactory.Make(
                    alternate: new List <SectorAlternateOwnerHierarchy>
            {
                SectorAlternateOwnerHierarchyFactory.Make(new List <string> {
                    first, second
                }),
                SectorAlternateOwnerHierarchyFactory.Make(new List <string> {
                    second, third, bad, first
                }),
            }
                    )
                );

            AssertValidationErrors();
        }
        public void TestItFailsOnInvalid(string first, string second, string third, int timesCalled)
        {
            sectorElements.Add(
                SectorFactory.Make(
                    arrivalAirports: new List <SectorArrivalAirports>
            {
                SectorArrivalAirportsFactory.Make(new List <string> {
                    first, second
                })
            }
                    )
                );
            sectorElements.Add(
                SectorFactory.Make(
                    arrivalAirports: new List <SectorArrivalAirports>
            {
                SectorArrivalAirportsFactory.Make(new List <string> {
                    second, third
                })
            }
                    )
                );

            AssertValidationErrors(timesCalled);
        }
 public AllSectorsMustHaveUniqueNameTest()
 {
     sectorElements = new SectorElementCollection();
     loggerMock     = new Mock <IEventLogger>();
     first          = SectorFactory.Make("ONE");
     second         = SectorFactory.Make("ONE");
     third          = SectorFactory.Make("NOTONE");
 }
        public void TestItReturnsElementsInOrder()
        {
            OutputGroup group1 = new("1");
            OutputGroup group2 = new("2");

            outputGroups.AddGroupWithFiles(group1, new List <string> {
                "foo.txt"
            });
            outputGroups.AddGroupWithFiles(group2, new List <string> {
                "goo.txt"
            });

            Sectorline       line1 = SectorlineFactory.Make(definition: DefinitionFactory.Make("foo.txt"));
            Sectorline       line2 = SectorlineFactory.Make(definition: DefinitionFactory.Make("goo.txt"));
            CircleSectorline line3 = CircleSectorlineFactory.Make(definition: DefinitionFactory.Make("foo.txt"));

            Sector sector1 = SectorFactory.Make(definition: DefinitionFactory.Make("goo.txt"));
            Sector sector2 = SectorFactory.Make(definition: DefinitionFactory.Make("foo.txt"));

            CoordinationPoint point1 = CoordinationPointFactory.Make(false, definition: DefinitionFactory.Make("foo.txt"));
            CoordinationPoint point2 = CoordinationPointFactory.Make(true, definition: DefinitionFactory.Make("foo.txt"));
            CoordinationPoint point3 = CoordinationPointFactory.Make(false, definition: DefinitionFactory.Make("goo.txt"));

            sectorElements.Add(line1);
            sectorElements.Add(line2);
            sectorElements.Add(line3);
            sectorElements.Add(sector1);
            sectorElements.Add(sector2);
            sectorElements.Add(point1);
            sectorElements.Add(point2);
            sectorElements.Add(point3);

            IEnumerable <ICompilableElementProvider> expected = new List <ICompilableElementProvider>()
            {
                line1,
                line3,
                line2,
                sector2,
                sector1,
                point1,
                point3,
                point2
            };

            AssertCollectedItems(expected);
        }
Пример #8
0
        public void TestItFailsOnInvalidControllers(string first, string second)
        {
            sectorElements.Add(
                SectorFactory.Make(
                    owners: SectorOwnerHierarchyFactory.Make(new List <string> {
                first
            })
                    )
                );
            sectorElements.Add(
                SectorFactory.Make(
                    owners: SectorOwnerHierarchyFactory.Make(new List <string> {
                first, second
            })
                    )
                );

            AssertValidationErrors();
        }
Пример #9
0
        public void TestItPassesOnValidControllers()
        {
            sectorElements.Add(
                SectorFactory.Make(
                    owners: SectorOwnerHierarchyFactory.Make(new List <string> {
                "LS", "LC"
            })
                    )
                );
            sectorElements.Add(
                SectorFactory.Make(
                    owners: SectorOwnerHierarchyFactory.Make(new List <string> {
                "LS", "LC", "BBR", "BBF"
            })
                    )
                );

            AssertNoValidationErrors();
        }
        public void TestItFailsOnInvalidControllers(string first, string second, string third, int numErrors)
        {
            sectorElements.Add(
                SectorFactory.Make(
                    guests: new List <SectorGuest>
            {
                SectorGuestFactory.Make(first),
                SectorGuestFactory.Make(third),
            }
                    )
                );
            sectorElements.Add(
                SectorFactory.Make(
                    guests: new List <SectorGuest>
            {
                SectorGuestFactory.Make(second),
                SectorGuestFactory.Make(third),
            }
                    )
                );

            AssertValidationErrors(numErrors);
        }
        public void TestItPassesOnValidControllers(string first, string second, string third)
        {
            sectorElements.Add(
                SectorFactory.Make(
                    guests: new List <SectorGuest>
            {
                SectorGuestFactory.Make(first),
                SectorGuestFactory.Make(third),
            }
                    )
                );
            sectorElements.Add(
                SectorFactory.Make(
                    guests: new List <SectorGuest>
            {
                SectorGuestFactory.Make(second),
                SectorGuestFactory.Make(third),
            }
                    )
                );

            AssertNoValidationErrors();
        }
        public void TestItFailsOnInvalid(string first, string second, string third, int timesCalled)
        {
            sectorElements.Add(
                SectorFactory.Make(
                    guests: new List <SectorGuest>
            {
                SectorGuestFactory.Make(firstAirport: first, secondAirport: second),
                SectorGuestFactory.Make(firstAirport: third, secondAirport: "*"),
            }
                    )
                );
            sectorElements.Add(
                SectorFactory.Make(
                    guests: new List <SectorGuest>
            {
                SectorGuestFactory.Make(firstAirport: third, secondAirport: first),
                SectorGuestFactory.Make(firstAirport: "*", secondAirport: "*"),
            }
                    )
                );

            AssertValidationErrors(timesCalled);
        }
Пример #13
0
        public void TestItFailsOnInvalid(string first, string second, string third, int timesCalled)
        {
            sectorElements.Add(
                SectorFactory.Make(
                    active: new List <SectorActive>
            {
                SectorActiveFactory.Make(first),
                SectorActiveFactory.Make(third)
            }
                    )
                );
            sectorElements.Add(
                SectorFactory.Make(
                    active: new List <SectorActive>
            {
                SectorActiveFactory.Make(second),
                SectorActiveFactory.Make(third)
            }
                    )
                );

            AssertValidationErrors(timesCalled);
        }
        public void TestItPassesOnAllValid(string first, string second, string third)
        {
            sectorElements.Add(
                SectorFactory.Make(
                    guests: new List <SectorGuest>
            {
                SectorGuestFactory.Make(firstAirport: first, secondAirport: second),
                SectorGuestFactory.Make(firstAirport: third, secondAirport: "*"),
            }
                    )
                );
            sectorElements.Add(
                SectorFactory.Make(
                    guests: new List <SectorGuest>
            {
                SectorGuestFactory.Make(firstAirport: third, secondAirport: first),
                SectorGuestFactory.Make(firstAirport: "*", secondAirport: "*"),
            }
                    )
                );

            AssertNoValidationErrors();
        }
Пример #15
0
        public void TestItPassesOnAllValid(string first, string second, string third)
        {
            sectorElements.Add(
                SectorFactory.Make(
                    active: new List <SectorActive>
            {
                SectorActiveFactory.Make(first),
                SectorActiveFactory.Make(third)
            }
                    )
                );
            sectorElements.Add(
                SectorFactory.Make(
                    active: new List <SectorActive>
            {
                SectorActiveFactory.Make(second),
                SectorActiveFactory.Make(third)
            }
                    )
                );

            AssertNoValidationErrors();
        }
Пример #16
0
        public void TestItPassesOnAllValid(string firstAirport, string firstRunway, string secondAirport, string secondRunway)
        {
            sectorElements.Add(
                SectorFactory.Make(
                    active: new List <SectorActive>
            {
                SectorActiveFactory.Make(firstAirport, firstRunway),
                SectorActiveFactory.Make(secondAirport, secondRunway),
            }
                    )
                );

            sectorElements.Add(
                SectorFactory.Make(
                    active: new List <SectorActive>
            {
                SectorActiveFactory.Make(firstAirport, firstRunway),
                SectorActiveFactory.Make(secondAirport, secondRunway),
            }
                    )
                );

            AssertNoValidationErrors();
        }
Пример #17
0
        public void TestItFailsOnInvalid(string firstAirport, string firstRunway, string secondAirport, string secondRunway, int failTimes)
        {
            sectorElements.Add(
                SectorFactory.Make(
                    active: new List <SectorActive>
            {
                SectorActiveFactory.Make(firstAirport, firstRunway),
                SectorActiveFactory.Make(secondAirport, secondRunway),
            }
                    )
                );

            sectorElements.Add(
                SectorFactory.Make(
                    active: new List <SectorActive>
            {
                SectorActiveFactory.Make(firstAirport, firstRunway),
                SectorActiveFactory.Make(secondAirport, secondRunway),
            }
                    )
                );

            AssertValidationErrors(failTimes);
        }
Пример #18
0
 public AllCoordinationPointsMustHaveValidFromSectorTest()
 {
     sectorElements.Add(SectorFactory.Make("COOL1"));
     sectorElements.Add(SectorFactory.Make("COOL2"));
 }
Пример #19
0
 public AllSectorlinesMustHaveValidDisplaySectorsTest()
 {
     sectorElements.Add(SectorFactory.Make("COOL1"));
     sectorElements.Add(SectorFactory.Make("COOL2"));
 }