예제 #1
0
 public void TestItPassesIfAirportExists()
 {
     sectorElements.Add(ActiveRunwayFactory.Make("EGLL"));
     sectorElements.Add(ActiveRunwayFactory.Make("EGKK"));
     sectorElements.Add(ActiveRunwayFactory.Make("EGCC"));
     AssertNoValidationErrors();
 }
예제 #2
0
        public void TestItReturnsElementsInOrder()
        {
            ActiveRunway first  = ActiveRunwayFactory.Make("EGLL", "09L", 0);
            ActiveRunway second = ActiveRunwayFactory.Make("EGLL", "27L", 0);
            ActiveRunway third  = ActiveRunwayFactory.Make("EGLL", "09L", 1);
            ActiveRunway fourth = ActiveRunwayFactory.Make("EGLL", "09R", 0);
            ActiveRunway fifth  = ActiveRunwayFactory.Make("EGKK", "26L", 0);

            sectorElements.Add(first);
            sectorElements.Add(second);
            sectorElements.Add(third);
            sectorElements.Add(fourth);
            sectorElements.Add(fifth);

            IEnumerable <ICompilableElementProvider> expected = new List <ICompilableElementProvider>()
            {
                fifth,
                first,
                third,
                fourth,
                second
            };

            AssertCollectedItems(expected);
        }
예제 #3
0
 public void TestItFailsIfAirportDoesntExist()
 {
     sectorElements.Add(ActiveRunwayFactory.Make("EGKB"));
     sectorElements.Add(ActiveRunwayFactory.Make("EGLC"));
     sectorElements.Add(ActiveRunwayFactory.Make("EGGD"));
     AssertValidationErrors(3);
 }
예제 #4
0
 public void TestItPassesOnNoDuplicates()
 {
     sectorElements.Add(ActiveRunwayFactory.Make("EGLL", "27R", 1));
     sectorElements.Add(ActiveRunwayFactory.Make("EGLL", "27R", 0));
     sectorElements.Add(ActiveRunwayFactory.Make("EGLL", "27L", 0));
     sectorElements.Add(ActiveRunwayFactory.Make("EGXY", "27L", 0));
     AssertNoValidationErrors();
 }
        public void TestItAddsActiveRunways()
        {
            ActiveRunway runway = ActiveRunwayFactory.Make();

            collection.Add(runway);

            Assert.Equal(runway, collection.ActiveRunways[0]);
        }
예제 #6
0
 public void TestItFailsIfDuplicatesExist()
 {
     sectorElements.Add(ActiveRunwayFactory.Make("EGLL", "27R", 1));
     sectorElements.Add(ActiveRunwayFactory.Make("EGLL", "27R", 1));
     sectorElements.Add(ActiveRunwayFactory.Make("EGLL", "27R", 0));
     sectorElements.Add(ActiveRunwayFactory.Make("EGLL", "27L", 1));
     sectorElements.Add(ActiveRunwayFactory.Make("EGLL", "27L", 1));
     sectorElements.Add(ActiveRunwayFactory.Make("EGLL", "27L", 0));
     sectorElements.Add(ActiveRunwayFactory.Make("EGLL", "27L", 0));
     AssertValidationErrors(3);
 }
예제 #7
0
 [InlineData("EGBB", "33", 1, true)]  // All the same
 public void TestEquality(string icao, string identifier, int mode, bool expected)
 {
     Assert.Equal(expected, activeRunway.Equals(ActiveRunwayFactory.Make(icao, identifier, mode)));
 }
 [InlineData("EGKK", "08R")] // Second identifier match
 public void TestItPassesIfRunwayExists(string icao, string identifier)
 {
     sectorElements.Add(ActiveRunwayFactory.Make(icao, identifier));
     AssertNoValidationErrors();
 }
 public void TestItFailsIfRunwayDoesntExist(string icao, string identifier)
 {
     sectorElements.Add(ActiveRunwayFactory.Make(icao, identifier));
     AssertValidationErrors();
 }