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); }
public void TestItAddsActiveRunways() { ActiveRunway runway = ActiveRunwayFactory.Make(); collection.Add(runway); Assert.Equal(runway, collection.ActiveRunways[0]); }
public ActiveRunwayTest() { this.activeRunway = new ActiveRunway( "33", "EGBB", 1, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public void TestItAddsDataInMode1() { RunParserOnLines(new List <string>(new[] { "ACTIVE_RUNWAY:EGHI:20:1 ;comment" })); ActiveRunway result = sectorElementCollection.ActiveRunways[0]; Assert.Equal("EGHI", result.Airfield); Assert.Equal("20", result.Identifier); Assert.Equal(1, result.Mode); AssertExpectedMetadata(result); }
public void Validate(SectorElementCollection sectorElements, CompilerArguments args, IEventLogger events) { var duplicates = sectorElements.ActiveRunways.GroupBy( runway => runway ) .Where(g => g.Count() > 1) .ToList(); if (!duplicates.Any()) { return; } foreach (var duplicate in duplicates) { ActiveRunway runway = duplicate.First(); events.AddEvent( new ValidationRuleFailure( $"Duplicate ACTIVE_RUNWAY {runway.Airfield}:{runway.Identifier}:{runway.Mode}", runway ) ); } }
private bool IsSameRunway(ActiveRunway activeRunway, Runway runway) { return(runway.AirfieldIcao == activeRunway.Airfield && (runway.FirstIdentifier == activeRunway.Identifier || runway.ReverseIdentifier == activeRunway.Identifier)); }