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 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 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 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);
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 12
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();
        }
        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);
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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);
        }
Exemplo n.º 18
0
 public AllCoordinationPointsMustHaveValidFromSectorTest()
 {
     sectorElements.Add(SectorFactory.Make("COOL1"));
     sectorElements.Add(SectorFactory.Make("COOL2"));
 }
Exemplo n.º 19
0
 public AllSectorlinesMustHaveValidDisplaySectorsTest()
 {
     sectorElements.Add(SectorFactory.Make("COOL1"));
     sectorElements.Add(SectorFactory.Make("COOL2"));
 }
 public DynamicDiskBlockFactory(VhdFile vhdFile) : base(vhdFile)
 {
     this.bitMapFactory = new BitMapFactory(vhdFile);
     this.sectorFactory = new SectorFactory(vhdFile, this);
 }
 public DynamicDiskBlockFactory(VhdFile vhdFile) : base(vhdFile)
 {
     this.bitMapFactory = new BitMapFactory(vhdFile);
     this.sectorFactory = new SectorFactory(vhdFile, this);
 }