public void Test_JMB() { StudentBachelor student1 = new StudentBachelor("Dzana", "Hanic", new DateTime(1995, 12, 27), "2712995111222", new DateTime(2014, 10, 10)); fax.upisiStudenta(student1); student1.validirajMaticni("2712995177657"); //test nece pasti jer je maticni ispravan }
public void Test_UpisiStudentaXML() { Fakultet fax = new Fakultet("ASU"); DateTime d1 = new DateTime( Convert.ToInt32(TestContext.DataRow["Godina"]), Convert.ToInt32(TestContext.DataRow["Mjesec"]), Convert.ToInt32(TestContext.DataRow["Dan"])); DateTime d2 = new DateTime( Convert.ToInt32(TestContext.DataRow["GodinaZ"]), Convert.ToInt32(TestContext.DataRow["MjesecZ"]), Convert.ToInt32(TestContext.DataRow["DanZ"])); StudentBachelor s = new StudentBachelor( Convert.ToString(TestContext.DataRow["Ime"]), Convert.ToString(TestContext.DataRow["Prezime"]), d1, Convert.ToString(TestContext.DataRow["Maticni"]), d2 ); fax.upisiStudenta(s); List <Student> studenti = fax.dajSveStudente(); Assert.AreEqual(s.MaticniBroj, studenti[0].MaticniBroj); }
public void Test_Podaci() { StudentMaster sM = new StudentMaster("Janis*1", "/1Joplin", new DateTime(1995, 12, 27), "2712995177657", DateTime.Now, "PFSA"); StudentBachelor sB = new StudentBachelor("Norah", "Jones321", new DateTime(1995, 12, 27), "2712995177657", new DateTime(2014, 10, 10)); //ocekivano je padanje jer format imena i prezimena nije tacan }
public void Test_FormatIndexBachelor() { StudentBachelor s = new StudentBachelor("Niko", "Nikic", new DateTime(1995, 12, 27), "2712995177657", new DateTime(2014, 10, 10)); Regex r = new Regex(@"^[0-9]{6}"); StringAssert.Matches(s.BrojIndeks, r); }
public void Test_IsplatiIzFonda() { //norma = 0.5 UposlenikStalni u1 = new UposlenikStalni("Novica", "Nosovic", new DateTime(1972, 10, 20), "2010972211444", Pozicija.RedovniProfesor, 0.5, "s", "prof dr"); StudentBachelor s1 = new StudentBachelor("Niko", "Nikic", new DateTime(1995, 12, 27), "2712995111222", new DateTime(2014, 10, 10)); fax.dodajUposlenika(u1); fax.upisiStudenta(s1); Assert.IsTrue(fax.isplatiIzFonda(u1.Plata)); }
public void Test_ProvjeraFonda() { //norma = 1.5 UposlenikStalni u1 = new UposlenikStalni("Novica", "Nosovic", new DateTime(1972, 10, 20), "2010972211444", Pozicija.RedovniProfesor, 1.5, "s", "prof dr"); StudentBachelor s1 = new StudentBachelor("Niko", "Nikic", new DateTime(1995, 12, 27), "2712995111222", new DateTime(2014, 10, 10)); fax.dodajUposlenika(u1); fax.upisiStudenta(s1); Assert.IsFalse(fax.isplatiIzFonda(u1.Plata)); //nece se isplatiti iz fonda jer je plata profesora veca od trenutnog stanja }
public void Test_Index() { Fakultet etf = new Fakultet("ETF"); StudentBachelor s1 = new StudentBachelor("Dzana", "Hanic", new DateTime(1995, 12, 27), "2712995177657", new DateTime(2014, 10, 10)); StudentBachelor s2 = new StudentBachelor("Ema", "Jukic", new DateTime(1995, 09, 28), "2809995177170", new DateTime(2014, 10, 10)); etf.upisiStudenta(s1); etf.upisiStudenta(s2); List <String> indeksi = etf.dajSveIndekse(); CollectionAssert.AllItemsAreUnique(indeksi); }
public void Test_IspravanIndeks() { StudentBachelor s1 = new StudentBachelor("Dzana", "Hanic", new DateTime(1995, 12, 27), "2712995177657", new DateTime(2014, 10, 10)); String iB = s1.BrojIndeks; StudentMaster s2 = new StudentMaster("Dzana", "Hanic", new DateTime(1995, 12, 27), "2712995177657", new DateTime(2017, 10, 10)); String iM = s2.BrojIndeks; fax.upisiStudenta(s1); fax.upisiStudenta(s2); Assert.AreEqual(iB, iM.Substring(4, 6)); }
public void Test_PolaganjeIstogPredmeta() { StudentBachelor student1 = new StudentBachelor("Dzana", "Hanic", new DateTime(1995, 12, 27), "2712995111222", new DateTime(2014, 10, 10)); fax.upisiStudenta(student1); List <Uposlenik> uposleni = new List <Uposlenik>(); UposlenikStalni u1 = new UposlenikStalni("Zeljko", "Juric", new DateTime(1972, 10, 20), "2010972111444", Pozicija.RedovniProfesor, 1, "s", "prof dr"); uposleni.Add(u1); fax.dodajUposlenika(u1); Predmet tp = new Predmet("TP", "Tehnike programiranja", "Bachelor", 14, 7, 100, 8, uposleni, "Programiranje for life"); fax.dodajPredmet(tp); student1.polaganjePredmeta(tp); student1.polaganjePredmeta(tp); }
public void Test_KapacitetPopunjen() { StudentBachelor student1 = new StudentBachelor("Nina", "Simone", new DateTime(1995, 03, 05), "0503996175032", new DateTime(2014, 10, 10)); fax.upisiStudenta(student1); StudentBachelor student2 = new StudentBachelor("Leonard", "Cohen", new DateTime(1993, 11, 20), "2011993180008", new DateTime(2014, 10, 10)); fax.upisiStudenta(student1); List <Uposlenik> uposleni = new List <Uposlenik>(); UposlenikStalni u1 = new UposlenikStalni("Novica", "Nosovic", new DateTime(1970, 05, 02), "0205970177176", Pozicija.RedovniProfesor, 1, "s", "prof dr"); uposleni.Add(u1); fax.dodajUposlenika(u1); //broj dozvoljenih studenata = 1 Predmet ld = new Predmet("LD", "Logički dizajn", "Bachelor", 14, 7, 1, 6, uposleni, "LD struggle"); student1.polaganjePredmeta(ld); student2.polaganjePredmeta(ld); //test nece pasti jer je izuzetak ocekivan (predmet ne mogu slusati/polagati 2 studenta jer je kapacitet 1) }
public void Test_JMB_Sadrzaj() { StudentBachelor student1 = new StudentBachelor("Dzana", "Hanic", new DateTime(1995, 12, 27), "2712995111222", new DateTime(2014, 10, 10)); student1.validirajMaticni("0712995111222"); //test nece pasti jer maticni nije ispravan (datum je 27) - ocekuje se exception }
public void Test_JMB_13() { StudentBachelor student1 = new StudentBachelor("Dzana", "Hanic", new DateTime(1995, 12, 27), "2712995111222", new DateTime(2014, 10, 10)); student1.validirajMaticni("271299511122"); //test nece pasti jer maticni ne sadrzi 13 cifri (ocekuje se exception) }