public void DetectSourceParser()
        {
            var certificateSource = CreateRealSourceForSupplier(supplier);

            var serialNumber = Path.GetRandomFileName();
            var catalog      = TestCatalogProduct.Queryable.First();
            var product      = TestProduct.Queryable.First(p => p.CatalogProduct == catalog);

            var documentLine = CreateBodyLine(serialNumber, product);

            var realDocument = Document.Find(documentLine.Waybill.Id);

            var source = CertificateSourceDetector.DetectSource(realDocument);

            Assert.That(source, Is.Not.Null);
            Assert.That(source.Id, Is.EqualTo(certificateSource.Id));
            Assert.That(source.CertificateSourceParser, Is.InstanceOf <AptekaHoldingVoronezhCertificateSource>());
        }
Exemple #2
0
 protected virtual CertificateSource DetectSource(CertificateTask certificateTask)
 {
     return(CertificateSourceDetector.DetectSource(certificateTask.DocumentLine.Document));
 }