Пример #1
0
        public void ParseRealGcodes(string filename)
        {
            var src    = EmbeddedFixture.ExtractFile(filename);
            var parser = new Parser(src);

            var got = parser.Parse().ToList();

            Assert.NotEmpty(got);
        }
Пример #2
0
        public void BaumerCodeHas64Items()
        {
            var src    = EmbeddedFixture.ExtractFile("371373P.gcode");
            var parser = new Parser(src);

            var numCodes = parser.Parse().Count();

            // manually counted the number of g/m codes in the baumer file :(
            Assert.Equal(64, numCodes);
        }
Пример #3
0
        public void YouCanLookUpLocationDetails(int index, int line, int column, char sanityCheck)
        {
            var src = EmbeddedFixture.ExtractFile("circle.gcode");

            Assert.Equal(sanityCheck, src[index]);
            var map      = new FileMap(src);
            var shouldBe = new Location(index, line, column);

            var got = map.LocationFor(index);

            Assert.Equal(shouldBe, got);
        }