Ejemplo n.º 1
0
        public void SanitizeNIPWithDashAndSpace()
        {
            string nip = "111-11 1  1 111";

            string sanitizedNip = SanitizeInput.RemoveDashAndSpace(nip);

            Assert.AreEqual("1111111111", sanitizedNip);
        }
Ejemplo n.º 2
0
        public void SanitizeNIPWithIncorrectLength()
        {
            string nip = "111 11 11 11111";

            string sanitizedNip = SanitizeInput.RemoveDashAndSpace(nip);

            Assert.AreNotEqual(10, sanitizedNip.Length);
        }
Ejemplo n.º 3
0
        public bool CheckValidityLicenseByNip(string nip)
        {
            nip = SanitizeInput.RemoveDashAndSpace(nip);

            bool isValidLicense = (from license in repoContext.Licenses
                                   join company in repoContext.Companies on license.lic_cmpid equals company.cmp_id
                                   where company.cmp_nip.Equals(nip)
                                   select new { license, company }).Any();

            return(isValidLicense);
        }