예제 #1
0
파일: CrtajMeTest.cs 프로젝트: dsantl/FER
        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");
        }
예제 #2
0
파일: CrtajMeTest.cs 프로젝트: dsantl/FER
        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");
        }
예제 #3
0
 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());
     }
 }
예제 #4
0
 /// <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());
     }
 }