예제 #1
0
        public void WithoutError()
        {
            var handler = new FakeWaybillLANSourceHandler("FakeSIAMoscow_2788_Reader4", supplierId);
            var res     = handler.MoveWaybill("test", "test");

            Assert.That(res, Is.True);
            var logs = session.Query <DocumentReceiveLog>().ToList();

            Assert.That(logs.Count, Is.EqualTo(1));
            Assert.That(logs[0].Supplier.Id, Is.EqualTo(supplierId));
            Assert.That(logs[0].Comment, Is.EqualTo("Получен с нашего FTP"));
        }
예제 #2
0
        public void FormatOutputFileError()
        {
            var handler = new FakeWaybillLANSourceHandler("FakeSIAMoscow_2788_Reader2", supplierId);
            var res     = handler.MoveWaybill("test", "test");

            Assert.That(res, Is.False);
            var logs = session.Query <DocumentReceiveLog>().ToList();

            Assert.That(logs.Count, Is.EqualTo(1));
            Assert.That(logs[0].Supplier.Id, Is.EqualTo(supplierId));
            Assert.That(logs[0].Comment.Contains("Количество позиций в документе не соответствует значению в заголовке документа"), Is.True);
        }
예제 #3
0
        public void ImportDocumentError()
        {
            var handler = new FakeWaybillLANSourceHandler("FakeSIAMoscow_2788_Reader3", supplierId);
            var res     = handler.MoveWaybill("test", "test");

            Assert.That(res, Is.False);
            var logs = session.Query <DocumentReceiveLog>().ToList();

            Assert.That(logs.Count, Is.EqualTo(1));
            Assert.That(logs[0].Supplier.Id, Is.EqualTo(supplierId));
            Assert.That(logs[0].Comment.Contains("Дублирующийся документ"), Is.True);
        }
예제 #4
0
        public void GetClientCodesErrorTest()
        {
            var handler = new FakeWaybillLANSourceHandler("FakeSIAMoscow_2788_Reader1", supplierId);
            var res     = handler.MoveWaybill("test", "test");

            Assert.That(res, Is.False);
            var logs = session.Query <DocumentReceiveLog>().ToList();

            Assert.That(logs.Count, Is.EqualTo(1));
            Assert.That(logs[0].Supplier.Id, Is.EqualTo(supplierId));
            Assert.That(logs[0].Comment.Contains("Не получилось сформировать SupplierClientId(FirmClientCode) и SupplierDeliveryId(FirmClientCode2) из документа."), Is.True);
        }