示例#1
0
        public void SprawdzCzyRowneTest()
        {
            Walidator walidator = new Walidator();

            bool wynikMetody = walidator.SprawdzCzyRowne("test", "test");

            Assert.AreEqual(wynikMetody, true);
        }
示例#2
0
        private void SearchBtn_Click(object sender, RoutedEventArgs e)
        {
            bool czyPoprawneDane = false;

            data = dateTb.Text;
            nr   = numberTb.Text;

            if (this.typ == Typ.NIP)
            {
                czyPoprawneDane = Walidator.WalidujNIP(nr);
            }
            else if (this.typ == Typ.REGON)
            {
                czyPoprawneDane = Walidator.WalidujRegon(nr);
            }
            else if (this.typ == Typ.RACHUNEK)
            {
                czyPoprawneDane = Walidator.WalidujRachunekBankowy(nr);
            }

            if (czyPoprawneDane)
            {
                BialaLista bl = new BialaLista(data, nr, this.typ);


                try
                {
                    raportVatJson = bl.PobierzRaport();
                    try
                    {
                        rv = new RaportVat(raportVatJson);
                        rv.Show();
                    }
                    catch (Exception err)
                    {
                        Console.WriteLine("Error" + err.ToString());;
                    }
                }
                catch (Exception error)
                {
                    errorLabel.Content = error.ToString();
                }
            }
            else
            {
                KomunikujBladWalidacji();
            }
        }
示例#3
0
    private List <byte> codeObjectIdentifier()
    {
        List <byte> lst = new List <byte>();
        Walidator   w1  = new Walidator(this.OID, content, drzewo);

        string idPattern = @"(?<id>\d*)(\.|\s*)";
        int    idSize    = Regex.Matches(OID, idPattern, RegexOptions.IgnoreCase | RegexOptions.Singleline).Count - 1;

        int[] localId    = new int[idSize];
        int   arrayIndex = 0;

        foreach (Match m in Regex.Matches(OID, idPattern, RegexOptions.IgnoreCase | RegexOptions.Singleline))
        {
            if (arrayIndex < idSize)
            {
                Int32.TryParse(Regex.Match(m.Value, @"\d*", RegexOptions.IgnoreCase | RegexOptions.Singleline).Value, out localId[arrayIndex]);
                arrayIndex++;
            }
        }

        //TWORZENIE RAMKI
        lst.Add(6);
        lst.Add(Convert.ToByte(idSize - 1));
        lst.Add(43);

        for (int i = 2; i < localId.Count(); i++)
        {
            lst.Add(Convert.ToByte(localId[i]));
        }

        //Data Visualization
        foreach (byte b in lst)
        {
            Console.Write(b + "  ");
        }

        return(lst);
    }
示例#4
0
 public Kalkulator(Walidator walidator)
 {
     _walidator = walidator;
 }
 public void PrzygotujWalidator()
 {
     w = new Walidator("02070803628");
 }
示例#6
0
 public void PrepareTest()
 {
     w = new Walidator("02070803628");
 }