Beispiel #1
0
        public void Run(IEnumerable <string> filepaths)
        {
            var imageTotalCounter = 0;
            var tableTotalCounter = 0;

            foreach (var filepath in filepaths)
            {
                var file = new MarkdownFile()
                {
                    FilePath = filepath
                };
                _inputReader.Read(file);
                _markdownChecker.Check(file);

                imageTotalCounter += file.ImageCount;
                tableTotalCounter += file.TableCount;
            }

            _outputWriter.Send(Utility.GetTotalImageCount(imageTotalCounter));
            _outputWriter.Send(Utility.GetTotalTableCount(tableTotalCounter));
        }
Beispiel #2
0
        public void SimpleImageWithDescription()
        {
            var lines = new List <string> {
                "![photo1](link)",
                "Рисунок 1"
            };

            var file = new MarkdownFile()
            {
                FilePath = "testFile",
                Lines    = lines
            };

            var result = _checker.Check(file);

            Assert.AreEqual(1, result.ImageCount);
            Assert.AreEqual(0, result.TableCount);

            // TODO: fix unstable equals
            Assert.IsTrue(result.Messages.ToList().Count == 0);
        }