public void TestItAddsMixedDataNoDisplayRules() { RunParserOnLines( new List <string>(new[] { "SECTORLINE:JJCTR - LS ;comment6", "COORD:N049.59.59.000:W002.29.35.000 ;comment9", "COORD:N050.00.00.000:W001.47.00.000 ;comment10", "", "CIRCLE_SECTORLINE:BBTWR:EGBB:2.5 ;comment", }) ); // First CircleSectorline result1 = sectorElementCollection.CircleSectorLines[0]; Assert.Equal("BBTWR", result1.Name); Assert.Equal("EGBB", result1.CentrePoint); Assert.Equal(2.5, result1.Radius); Assert.Empty(result1.DisplayRules); // Second Sectorline result2 = sectorElementCollection.SectorLines[0]; Assert.Equal("JJCTR - LS", result2.Name); Assert.Empty(result2.DisplayRules); }
public void TestItAddsCircleSectorlines() { CircleSectorline sectorline = CircleSectorlineFactory.Make(); collection.Add(sectorline); Assert.Equal(sectorline, collection.CircleSectorLines[0]); }
public AllSectorlineElementsMustHaveUniqueNameTest() { sectorElements = new SectorElementCollection(); loggerMock = new Mock <IEventLogger>(); first = new Sectorline( "ONE", SectorLineDisplayRuleFactory.MakeList(2), SectorlineCoordinateFactory.MakeList(2), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); second = new Sectorline( "ONE", SectorLineDisplayRuleFactory.MakeList(2), SectorlineCoordinateFactory.MakeList(2), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); third = new Sectorline( "NOTONE", SectorLineDisplayRuleFactory.MakeList(2), SectorlineCoordinateFactory.MakeList(2), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); fourth = new CircleSectorline( "ONE", "EGGD", 5.5, SectorLineDisplayRuleFactory.MakeList(3), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); fifth = new CircleSectorline( "NOTONEORTWO", "EGGD", 5.5, SectorLineDisplayRuleFactory.MakeList(), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); sixth = new CircleSectorline( "ONE", "EGGD", 5.5, SectorLineDisplayRuleFactory.MakeList(2), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); rule = new AllSectorlineElementsMustHaveUniqueName(); args = new CompilerArguments(); }
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); }
public void TestItAddsCircleSectorlines() { RunParserOnLines( new List <string>(new[] { "CIRCLE_SECTORLINE:BBTWR:EGBB:2.5 ;comment", "DISPLAY:BBAPP:BBAPP:BBTWR ;comment1", "DISPLAY:BBTWR:BBAPP:BBTWR ;comment2", "CIRCLE_SECTORLINE:AEAPP:N054.39.27.000:W006.12.57.000:30 ;comment3", "DISPLAY:AEAPP:AEAPP:Rathlin West ;comment4" }) ); // First CircleSectorline result1 = sectorElementCollection.CircleSectorLines[0]; Assert.Equal("BBTWR", result1.Name); Assert.Equal("EGBB", result1.CentrePoint); Assert.Equal(2.5, result1.Radius); AssertExpectedMetadata(result1); Assert.Equal(2, result1.DisplayRules.Count); Assert.Equal("BBAPP", result1.DisplayRules[0].ControlledSector); Assert.Equal("BBAPP", result1.DisplayRules[0].CompareSectorFirst); Assert.Equal("BBTWR", result1.DisplayRules[0].CompareSectorSecond); AssertExpectedMetadata(result1.DisplayRules[0], 2, "comment1"); Assert.Equal("BBTWR", result1.DisplayRules[1].ControlledSector); Assert.Equal("BBAPP", result1.DisplayRules[1].CompareSectorFirst); Assert.Equal("BBTWR", result1.DisplayRules[1].CompareSectorSecond); AssertExpectedMetadata(result1.DisplayRules[1], 3, "comment2"); // Second CircleSectorline result2 = sectorElementCollection.CircleSectorLines[1]; Assert.Equal("AEAPP", result2.Name); Assert.Equal(new Coordinate("N054.39.27.000", "W006.12.57.000"), result2.CentreCoordinate); Assert.Equal(30, result2.Radius); AssertExpectedMetadata(result2, 4, "comment3"); Assert.Single(result2.DisplayRules); Assert.Equal("AEAPP", result2.DisplayRules[0].ControlledSector); Assert.Equal("AEAPP", result2.DisplayRules[0].CompareSectorFirst); Assert.Equal("Rathlin West", result2.DisplayRules[0].CompareSectorSecond); AssertExpectedMetadata(result2.DisplayRules[0], 5, "comment4"); }
public void TestItAddsMixedData() { RunParserOnLines( new List <string>(new[] { "SECTORLINE:JJCTR - LS ;comment6", "DISPLAY:London AC Worthing:JJCTR:JJCTR ;comment7", "DISPLAY:JJCTR:JJCTR:London AC Worthing ;comment8", "COORD:N049.59.59.000:W002.29.35.000 ;comment9", "COORD:N050.00.00.000:W001.47.00.000 ;comment10", "", "CIRCLE_SECTORLINE:BBTWR:EGBB:2.5 ;comment", "DISPLAY:BBAPP:BBAPP:BBTWR ;comment1", "DISPLAY:BBTWR:BBAPP:BBTWR ;comment2", }) ); // First CircleSectorline result1 = sectorElementCollection.CircleSectorLines[0]; Assert.Equal("BBTWR", result1.Name); Assert.Equal("EGBB", result1.CentrePoint); Assert.Equal(2.5, result1.Radius); AssertExpectedMetadata(result1, 7); Assert.Equal(2, result1.DisplayRules.Count); Assert.Equal("BBAPP", result1.DisplayRules[0].ControlledSector); Assert.Equal("BBAPP", result1.DisplayRules[0].CompareSectorFirst); Assert.Equal("BBTWR", result1.DisplayRules[0].CompareSectorSecond); AssertExpectedMetadata(result1.DisplayRules[0], 8, "comment1"); Assert.Equal("BBTWR", result1.DisplayRules[1].ControlledSector); Assert.Equal("BBAPP", result1.DisplayRules[1].CompareSectorFirst); Assert.Equal("BBTWR", result1.DisplayRules[1].CompareSectorSecond); AssertExpectedMetadata(result1.DisplayRules[1], 9, "comment2"); // Second Sectorline result2 = sectorElementCollection.SectorLines[0]; Assert.Equal("JJCTR - LS", result2.Name); AssertExpectedMetadata(result2, 1, "comment6"); Assert.Equal(2, result2.DisplayRules.Count); Assert.Equal("London AC Worthing", result2.DisplayRules[0].ControlledSector); Assert.Equal("JJCTR", result2.DisplayRules[0].CompareSectorFirst); Assert.Equal("JJCTR", result2.DisplayRules[0].CompareSectorSecond); AssertExpectedMetadata(result2.DisplayRules[0], 2, "comment7"); Assert.Equal("JJCTR", result2.DisplayRules[1].ControlledSector); Assert.Equal("JJCTR", result2.DisplayRules[1].CompareSectorFirst); Assert.Equal("London AC Worthing", result2.DisplayRules[1].CompareSectorSecond); AssertExpectedMetadata(result2.DisplayRules[1], 3, "comment8"); Assert.Equal(2, result2.Coordinates.Count); Assert.Equal(new Coordinate("N049.59.59.000", "W002.29.35.000"), result2.Coordinates[0].Coordinate); AssertExpectedMetadata(result2.Coordinates[0], 4, "comment9"); Assert.Equal(new Coordinate("N050.00.00.000", "W001.47.00.000"), result2.Coordinates[1].Coordinate); AssertExpectedMetadata(result2.Coordinates[1], 5, "comment10"); }