Пример #1
0
        public void NotInEvidence()
        {
            using (var httpClient = new HttpClient())
                using (var client = new MvcrDocumentValidatorClient(httpClient, new List <IDocumentValidator>()
                {
                    new GunLicenseValidator()
                }))
                {
                    var id       = "AL163692";
                    var responce = client.ValideAsync(id, DocumentTypeRequest.GunLicense).GetAwaiter().GetResult();

                    Assert.IsFalse(responce.Responce.Evidented);
                    Assert.AreEqual(id, $"{responce.Request.Serie}{responce.Request.Number}");

                    Assert.AreEqual(DocumentType.GunLicense, client.ResolveTypes(id).First());
                }
        }
        public void InEvidence()
        {
            using (var httpClient = new HttpClient())
                using (var client = new MvcrDocumentValidatorClient(httpClient, new List <IDocumentValidator>()
                {
                    new OldIdentityCardValidator()
                }))
                {
                    var id       = "AA321305";
                    var responce = client.ValideAsync(id, DocumentTypeRequest.IdentityCard).GetAwaiter().GetResult();

                    Assert.IsTrue(responce.Responce.Evidented);
                    Assert.AreEqual(id, $"{responce.Request.Serie}{responce.Request.Number}");

                    Assert.AreEqual(DocumentType.IdentityCardOld, client.ResolveTypes(id).First());
                }
        }
Пример #3
0
        public void NotInEvidence()
        {
            using (var httpClient = new HttpClient())
                using (var client = new MvcrDocumentValidatorClient(httpClient, new List <IDocumentValidator>()
                {
                    new NewIdentityCardValidator()
                }))
                {
                    var id       = "114343325";
                    var responce = client.ValideAsync(id, DocumentTypeRequest.IdentityCard).GetAwaiter().GetResult();

                    Assert.IsFalse(responce.Responce.Evidented);
                    Assert.AreEqual(id, responce.Request.Number);
                    Assert.AreEqual("-", responce.Request.Serie);

                    Assert.AreEqual(DocumentType.IdentityCardNew, client.ResolveTypes(id).First());
                }
        }
        public void NotInEvidence()
        {
            using (var httpClient = new HttpClient())
                using (var client = new MvcrDocumentValidatorClient(httpClient, new List <IDocumentValidator>()
                {
                    new PurplePassportValidator()
                }))
                {
                    var id       = "39477953";
                    var responce = client.ValideAsync(id, DocumentTypeRequest.PurplePassport).GetAwaiter().GetResult();

                    Assert.IsFalse(responce.Responce.Evidented);
                    Assert.AreEqual(id, responce.Request.Number);
                    Assert.AreEqual("-", responce.Request.Serie);

                    Assert.AreEqual(DocumentType.PurplePassport, client.ResolveTypes(id).First());
                }
        }