public void Parse_waybillIssueForRedmine_NoIssueForSuccess()
        {
            Parse_waybillCleanRedmineIssueTable();
            var fileName = "1008fo.pd";
            var log      = ParseFileForRedmine(fileName);
            var res      = MetadataOfLog.GetMetaFromDataBaseCount(Settings.Default.RedmineProjectForWaybillIssue, new MetadataOfLog(log).Hash);

            Assert.That(res, Is.EqualTo(0));
        }
        public void Parse_waybillIssueForRedmine_NoIssueNoClientFlag()
        {
            Parse_waybillCleanRedmineIssueTable();
            //если не клиент не промаркерован, по его накладной задачу не создаем
            var nofileName = "1008foBroken.DBF";
            var nolog      = ParseFileForRedmine(nofileName, false);
            var nores      = MetadataOfLog.GetMetaFromDataBaseCount(Settings.Default.RedmineProjectForWaybillIssue, new MetadataOfLog(nolog).Hash);

            Assert.That(nores, Is.EqualTo(0));
        }
        public void Parse_waybillIssueForRedmine_IssueFromOneNotDbfFormatPriority()
        {
            Parse_waybillCleanRedmineIssueTable();
            var doubleTest = "";
            var fileName   = "1008foBroken.pd";
            var log        = ParseFileForRedmine(fileName, changeValues: false, priority: true);
            var res        = MetadataOfLog.GetMetaFromDataBaseCount(Settings.Default.RedmineProjectForWaybillIssueWithPriority, new MetadataOfLog(log).Hash);

            //должен создаваться один, т.к. файл не формата DBF, но обработкая приоритетна
            Assert.That(res, Is.EqualTo(1));
        }
        public void Parse_waybillIssueForRedmine_IssueFromOneNotDbfFormat()
        {
            Parse_waybillCleanRedmineIssueTable();
            var doubleTest = "";
            var fileName   = "1008foBroken.pd";
            var log        = ParseFileForRedmine(fileName, changeValues: false);
            var res        = MetadataOfLog.GetMetaFromDataBaseCount(Settings.Default.RedmineProjectForWaybillIssue, new MetadataOfLog(log).Hash);

            //не должно быть результата, т.к. файл не формата DBF
            Assert.That(res, Is.EqualTo(0));
        }
        public void Parse_waybillIssueForRedmine_rejectNoIssueForException()
        {
            Parse_waybillCleanRedmineIssueTable();

            var doubleTest = "";

            for (var i = 0; i < 2; i++)
            {
                var fileName = "1008foBroken.DBF";
                var log      = ParseFileForRedmine(fileName, createIssue: true, documentType: DocType.Reject, exceptionAdd: true);
                var res      = MetadataOfLog.GetMetaFromDataBaseCount(Settings.Default.RedmineProjectForWaybillIssue,
                                                                      new MetadataOfLog(log).Hash);
                //должен создаваться только один
                Assert.That(res, Is.EqualTo(0));
                Assert.IsTrue(log.Comment.IndexOf($"Разбор документа не производился, применена маска исключения '{"*.dbf"}'.") != -1);
            }
        }
        public void Parse_waybillIssueForRedmine_IssueFromMany()
        {
            Parse_waybillCleanRedmineIssueTable();
            var doubleTest = "";

            for (var i = 0; i < 2; i++)
            {
                var fileName = "1008foBroken.DBF";
                var log      = ParseFileForRedmine(fileName);
                var res      = MetadataOfLog.GetMetaFromDataBaseCount(Settings.Default.RedmineProjectForWaybillIssue, new MetadataOfLog(log).Hash);
                //для разных хэшей создается по одной задаче
                Assert.That(res, Is.EqualTo(1), $"Вместо 1 эл., в списке {res}. Шаг {i}.");
                if (doubleTest != string.Empty)
                {
                    Assert.That(doubleTest, Is.Not.EqualTo(new MetadataOfLog(log).Hash));
                }
                doubleTest = new MetadataOfLog(log).Hash;
            }
        }
        public void Parse_waybillIssueForRedmine_IssueFromOnePriority()
        {
            Parse_waybillCleanRedmineIssueTable();
            var doubleTest = "";

            for (var i = 0; i < 2; i++)
            {
                var fileName = "1008foBroken.DBF";
                var log      = ParseFileForRedmine(fileName, changeValues: false, priority: true);
                var res      = MetadataOfLog.GetMetaFromDataBaseCount(Settings.Default.RedmineProjectForWaybillIssueWithPriority, new MetadataOfLog(log).Hash);
                //должен создаваться только один
                Assert.That(res, Is.EqualTo(1));
                //для одного и того же хэша
                if (doubleTest != string.Empty)
                {
                    Assert.That(doubleTest, Is.EqualTo(new MetadataOfLog(log).Hash));
                }
                doubleTest = new MetadataOfLog(log).Hash;
            }
        }