예제 #1
0
        public void TestEqualEx()
        {
            Posiljaoc p  = new Posiljaoc("Ame", "Spica", "2901994175003", "+38762-282-330", "bla");
            Posiljaoc p2 = new Posiljaoc("Amela", "Spica", "2901994175003", "+38762-282-330", "bla");

            Assert.IsFalse(p == p2);
        }
예제 #2
0
        public void TestGet()
        {
            Posiljaoc p  = new Posiljaoc("Amela", "Spica", "2901994175003", "+38762-282-330", "bla");
            Posiljaoc p2 = new Posiljaoc("Amela", "Spica", "2901994175003", "+38762-282-330", "bla");

            Assert.AreEqual(p, p2);
        }
예제 #3
0
 public void TestConst2()
 {
     Posiljaoc  p      = new Posiljaoc("Amela", "Spica", "2901994175003", "+38762-282-330", "bla");
     Let        l      = new Let(9363, 4, 0.125, 2);
     double     cijena = l.izracunajCijenu();
     UneseniLet ul     = new UneseniLet(p, l, 1, cijena);
 }
예제 #4
0
        public void TestPosiljalacEx()
        {
            UneseniLet ul = new UneseniLet();
            Posiljaoc  p  = null;
            Let        l  = new Let(9363, 4, 0.125, 2);

            ul.posiljaoc = p;
            Assert.AreEqual(ul.posiljaoc, p);
        }
예제 #5
0
        public void TestCons()
        {
            Let        l      = new Let(9363, 4, 0.125, 2);
            Posiljaoc  p      = new Posiljaoc("Amela", "Spica", "2901994175003", "+38762-282-330", "bla");
            double     cijena = l.izracunajCijenu();
            UneseniLet ul     = new UneseniLet(p, l, 1, cijena);
            Lufthansa  lf     = new Lufthansa();

            lf.letovi.Add(ul);
        }
예제 #6
0
        public void TestWriteXML()
        {
            Let        l      = new Let(9363, 4, 0.125, 2);
            Posiljaoc  p      = new Posiljaoc("Amela", "Spica", "2901994175003", "+38762-282-330", "bla");
            double     cijena = l.izracunajCijenu();
            UneseniLet ul     = new UneseniLet(p, l, 1, cijena);
            Lufthansa  lf     = new Lufthansa();

            lf.letovi.Add(ul);
            XMLSerialization.WriteXML <List <UneseniLet> >(lf.letovi);
        }
예제 #7
0
        public void TestCijenaEx2()
        {
            UneseniLet ul = new UneseniLet();
            Posiljaoc  p  = new Posiljaoc("Amela", "Spica", "2901994175003", "+38762-282-330", "bla");
            Let        l  = new Let(9363, 4, 0.125, 2);

            ul.posiljaoc = p;
            ul.let       = l;
            ul.cijena    = 1220;
            double cijena = 1280.15;

            Assert.AreEqual(ul.cijena, cijena);
        }
예제 #8
0
        public void TestMock()
        {
            Lufthansa lf = new Lufthansa();

            service = new MockLetoviService();

            Posiljaoc  p  = new Posiljaoc("Amela", "Spica", "2901994175003", "+38762-282-330", "bla");
            Let        l  = new Let(9363, 4, 0.125, 2);
            UneseniLet ul = new UneseniLet(p, l, 20, l.izracunajCijenu());

            lf.letovi.Add(ul);
            if (service.potvrdiLet(p.JMBG, l.distanca, l.klasa))
            {
                service.evidentirajLet(ul);
            }

            Assert.AreEqual(lf.letovi.Count, service.brojac()); //spy
            Assert.IsTrue(service.letPostoji(ul.ID));
        }
예제 #9
0
        public void TestGet()
        {
            UneseniLet ul  = new UneseniLet();
            UneseniLet ul2 = new UneseniLet();
            Let        l   = new Let(9363, 4, 0.125, 2);
            Let        l2  = new Let(9363, 4, 0.125, 2);
            Posiljaoc  p   = new Posiljaoc("Amela", "Spica", "2901994175003", "+38762-282-330", "bla");
            Posiljaoc  p2  = new Posiljaoc("Amela", "Spica", "2901994175003", "+38762-282-330", "bla");

            int id = 0;

            ul.let  = l;
            ul2.let = l2;

            ul.ID = id;

            ul.posiljaoc  = p;
            ul2.posiljaoc = p2;

            Assert.AreEqual(ul.let, ul2.let);
            Assert.AreEqual(ul.posiljaoc, ul2.posiljaoc);
            Assert.AreEqual(ul.ID, 0);
        }
예제 #10
0
        public void XMLCitanje_DataDrivenTest()
        {
            int    id       = Convert.ToInt32(TestContext.DataRow["ID"]);
            string ime      = Convert.ToString(TestContext.DataRow["ime"]);
            string prezime  = Convert.ToString(TestContext.DataRow["prezime"]);
            string jmbg     = TestContext.DataRow["JMBG"].ToString();
            double distanca = Convert.ToDouble(TestContext.DataRow["distanca"]);
            int    klasa    = Convert.ToInt32(TestContext.DataRow["klasa"]);
            Let    l        = new Let(Convert.ToDouble(TestContext.DataRow["distanca"]),
                                      Convert.ToInt32(TestContext.DataRow["prtljag"]),
                                      Convert.ToDouble(TestContext.DataRow["taksa"]),
                                      Convert.ToInt32(TestContext.DataRow["klasa"]));
            Posiljaoc p = new Posiljaoc(ime, prezime, jmbg,
                                        TestContext.DataRow["kontakt"].ToString(),
                                        TestContext.DataRow["komentar"].ToString());
            double     cijena = Convert.ToDouble(TestContext.DataRow["cijena"]);
            UneseniLet ul     = new UneseniLet(p, l, id, cijena);

            service.evidentirajLet(ul);
            //provjera da li postoji let
            Assert.IsTrue(service.letPostoji(id));
            Assert.IsTrue(service.potvrdiLet(jmbg, distanca, klasa));
        }
예제 #11
0
        public void TestToString()
        {
            Posiljaoc p = new Posiljaoc("Amela", "Spica", "2901994175003", "+38762-282-330", "bla");

            Assert.AreEqual(p.ToString(), "Amela Spica");
        }
예제 #12
0
 public void TestPrezimeEx()
 {
     Posiljaoc p = new Posiljaoc("Amela", "S", "201994175003", "+38762-282-330", "bla");
 }
예제 #13
0
 public void TestKontaktEx()
 {
     Posiljaoc p = new Posiljaoc("Amela", "Spica", "201994175003", "+38762282-330", "bla");
 }
예제 #14
0
 public void TestImeEx()
 {
     Posiljaoc p = new Posiljaoc("A", "Spica", "201994175003", "+38762-282-330", "bla");
 }
예제 #15
0
 public void TestInvalidDigitsNumberJMBG()
 {
     Posiljaoc p = new Posiljaoc("Amela", "Spica", "201994175003", "+38762-282-330", "bla");
 }
예제 #16
0
        public void TestCons()
        {
            Posiljaoc p = new Posiljaoc();

            Assert.IsTrue(p != null);
        }
예제 #17
0
 public void TestInvalidDigitsNumber()
 {
     Posiljaoc p = new Posiljaoc("Amela", "Spica", "201994175003", "+287682-330", "bla");
     //Assert.IsFalse(p)
 }
예제 #18
0
 public void TestConstructorEx()
 {
     Posiljaoc p = new Posiljaoc("Amela", "Spica", "2901997175003", "+38762-282-330", "bla");
 }