Exemplo n.º 1
0
        public void Provera_AskClient_UnosPodataka_LosaIzmerenaVrednost()
        {
            Informer i     = new Informer();
            var      input = new StringReader("1\nVOJVODINA\n35/25/15/24/8/2020\na8b4");

            Console.SetIn(input);
            Assert.Throws <FormatException>(() => { i.AskClient(); }, "Pogresan format! Nije unet broj!");
        }
Exemplo n.º 2
0
        public void Provera_AskClient_UnosPodataka_Drugi_NemogucaKonverzijaDatuma()
        {
            Informer i     = new Informer();
            var      input = new StringReader("2\n25/ssx/2020");

            Console.SetIn(input);
            Assert.Throws <ArgumentException>(() => i.AskClient());
        }
Exemplo n.º 3
0
        public void Provera_AskClient_UnosPodataka_LosDatum_BrojVanOpsega()
        {
            Informer i     = new Informer();
            var      input = new StringReader("1\nVOJVODINA\n78/99/23/24/8/2020\n326.15");

            Console.SetIn(input);
            Assert.Catch(() => i.AskClient(), "Pogresan format! Neki od podataka ima vrednost vecu/manju nego sto bi smeo da ima.");
        }
Exemplo n.º 4
0
        public void Provera_AskClient_UnosPodataka_LosDatum_PogresanBrojParametara()
        {
            Informer i     = new Informer();
            var      input = new StringReader("1\nVOJVODINA\n/24/8/2020\n326.15");

            Console.SetIn(input);
            Assert.Catch(() => i.AskClient(), "Pogresan format! Niste uneli neki parametar ili ste ih uneli previse.");
        }
Exemplo n.º 5
0
        public void Provera_AskClient_UnosPodataka_LosDatum_NemogucaKonverzija()
        {
            Informer i     = new Informer();
            var      input = new StringReader("1\nVOJVODINA\nDA/NE/MOZDA/24/8/2020\n326.15");

            Console.SetIn(input);
            Assert.Catch(() => i.AskClient(), "Pogresan format! Nije moguce pretvoriti neki od parametara u broj. ");
        }
Exemplo n.º 6
0
        public void Provera_AskClient_UnosPodataka_Drugi_BrojeviVanOpsegaZaDatum()
        {
            Informer i     = new Informer();
            var      input = new StringReader("2\n25/99/2020");

            Console.SetIn(input);
            Assert.Throws <ArgumentOutOfRangeException>(() => i.AskClient());
        }
Exemplo n.º 7
0
        public void Provera_AskClient_UnosPodataka_Drugi_DobarDijalog()
        {
            Informer i          = new Informer();
            string   teststring = string.Format("2;25/2/2020");
            var      input      = new StringReader("2\n25/2/2020");

            Console.SetIn(input);
            Assert.AreEqual(teststring, i.AskClient());
        }
Exemplo n.º 8
0
        public void Provera_AskClient_UnosPodataka_DobarDijalog()
        {
            Informer i          = new Informer();
            string   teststring = string.Format("1;VOJVODINA;35/25/15/24/8/2020;326.15");
            var      input      = new StringReader("1\nVOJVODINA\n35/25/15/24/8/2020\n326.15");

            Console.SetIn(input);
            Assert.AreEqual(teststring, i.AskClient());
        }
Exemplo n.º 9
0
        public void Provera_AskClient_UnosPodataka_LosRegion()
        {
            Informer i          = new Informer();
            string   teststring = string.Format("1;VOJVODINA;35/25/15/24/8/2020;326.15");
            var      input      = new StringReader("1\n\n35/25/15/24/8/2020\n326.15");

            Console.SetIn(input);
            Assert.Catch(() => i.AskClient(), "Neispravna vrednost za region");
        }