public void NevaljanUlazniObrazac() { System.IO.StreamWriter dat = new System.IO.StreamWriter("_testNevaljanUlazni.txt"); dat.WriteLine("InputPattern-HardParsingProblem"); dat.WriteLine("Prva linija ulaza"); dat.Close(); UlazniObrazac ulazni = CrtajMeModel.Factories.UlazniObrazacFactory.CreateNewUlazniObrazac("_testNevaljanUlazni.txt"); System.IO.File.Delete("_testNevaljanUlazni.txt"); }
public void ValjaniUlazniObrazac() { System.IO.StreamWriter dat = new System.IO.StreamWriter("_testValjaniUlazni.txt"); dat.WriteLine("InputPattern-Simple"); dat.WriteLine("Prva linija ulaza"); dat.Close(); UlazniObrazac ulazni = CrtajMeModel.Factories.UlazniObrazacFactory.CreateNewUlazniObrazac("_testValjaniUlazni.txt"); Assert.AreEqual(ulazni.generateInput(), "Prva linija ulaza\n"); System.IO.File.Delete("_testValjaniUlazni.txt"); }
public void LoadUlazniObrazac(IMainForm frm, string name) { try { UlazniObrazac obrazac = CrtajMeModel.Factories.UlazniObrazacFactory.CreateNewUlazniObrazac(name); UlazniObrazacRepos.Instance().Add(obrazac); } catch (CrtajMeException e) { frm.ShowErrorMessage(e.getMsg()); } }
/// <summary> /// Glavna metoda koja testira /// </summary> /// <param name="ulazniName">Ime ulaznog obrasca</param> /// <param name="izlazniName">Ime izlazng obrasca</param> /// <param name="tipName">Tip prikaza</param> public void RunTest(IMainForm frm, IVisualView graph, string applicationName, string ulazniName, string izlazniName, string tipName, string prikazName) { try { UlazniObrazac input = UlazniObrazacRepos.Instance().GetObrazac(ulazniName); IzlazniObrazac output = IzlazniObrazacRepos.Instance().GetObrazac(izlazniName); Prikaz newPrikaz = CrtajMeModel.Factories.PrikazFactory.CreateNewPrikaz(prikazName, 0, tipName); Tester.Config(applicationName, newPrikaz, input, output); List <object> attList = new List <object>(); attList.Add(frm); attList.Add(graph); attList.Add(newPrikaz); Thread thr = new Thread(new ParameterizedThreadStart(this.TestThread)); thr.Start(attList); while (!thr.IsAlive) { ; } } catch (CrtajMeException e) { frm.ShowErrorMessage(e.getMsg()); } }