public void TestItAddsCircleSectorlines()
        {
            CircleSectorline sectorline = CircleSectorlineFactory.Make();

            collection.Add(sectorline);
            Assert.Equal(sectorline, collection.CircleSectorLines[0]);
        }
        public AllSectorsMustHaveValidBorderTest()
        {
            sectorElements = new SectorElementCollection();
            loggerMock     = new Mock <IEventLogger>();
            rule           = new AllSectorsMustHaveValidBorder();
            args           = new CompilerArguments();

            sectorElements.Add(SectorlineFactory.Make("ONE"));
            sectorElements.Add(SectorlineFactory.Make("TWO"));
            sectorElements.Add(CircleSectorlineFactory.Make("THREE"));
        }
        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);
        }
Esempio n. 4
0
        public void TestItFailsOnInvalidSector(string oneA, string twoA, string threeA, string oneB, string twoB, string threeB)
        {
            sectorElements.Add(
                CircleSectorlineFactory.Make(
                    displayRules: new List <SectorlineDisplayRule> {
                SectorLineDisplayRuleFactory.Make(oneA, twoA, threeA),
            }
                    )
                );
            sectorElements.Add(
                CircleSectorlineFactory.Make(
                    displayRules: new List <SectorlineDisplayRule> {
                SectorLineDisplayRuleFactory.Make(oneB, twoB, threeB),
            }
                    )
                );

            AssertValidationErrors();
        }
Esempio n. 5
0
        public void TestItFailsOnInvalidFix(string firstFix, string secondFix)
        {
            sectorElements.Add(CircleSectorlineFactory.Make(centre: firstFix));
            sectorElements.Add(CircleSectorlineFactory.Make(centre: secondFix));

            // This one is ignored by the rule
            sectorElements.Add(
                new CircleSectorline(
                    "ONE",
                    new Coordinate("abc", "def"),
                    5.5,
                    SectorLineDisplayRuleFactory.MakeList(2),
                    DefinitionFactory.Make(),
                    DocblockFactory.Make(),
                    CommentFactory.Make()
                    )
                );

            AssertValidationErrors();
        }