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!"); }
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()); }
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."); }
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."); }
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. "); }
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()); }
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()); }
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()); }
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"); }