示例#1
0
        public void TankanjeNaZacetkuNapacno()
        {
            Vozilo testno = new Vozilo(60, 5);

            double[] prva_pot = new double[] { 500 };
            testno.Prevozi(prva_pot);
            double[] pot   = new double[] { 0, 500, 0, 200, 0, 20 };
            bool     konca = testno.Prevozi(pot);

            Assert.AreEqual(konca, true);
        }
示例#2
0
        public void PotZTankanjem()
        {
            Vozilo testno = new Vozilo(60, 5);

            double[] pot = new double[] { 100, 50, 0 };
            testno.Prevozi(pot);
            Assert.AreEqual(testno.PreostaliKilometri, 1200);
        }
示例#3
0
        public void ZmanjkaBencina()
        {
            Vozilo testno = new Vozilo(60, 5);

            double[] pot   = new double[] { 100, 50, 0, 500, 400, 400 };
            bool     konca = testno.Prevozi(pot);

            Assert.AreEqual(konca, false);
        }
示例#4
0
        public void AliPrevozi()
        {
            Vozilo testno = new Vozilo(60, 5);

            double[] pot   = new double[] { 100, 50, 0 };
            bool     konca = testno.Prevozi(pot);

            Assert.AreEqual(konca, true);
        }
示例#5
0
        public void TankanjeNaZacetkuPravilno()
        {
            Vozilo testno = new Vozilo(60, 5);

            double[] pot     = new double[] { 0, 500, 0, 200, 0, 20 };
            Action   preveri = () => testno.Prevozi(pot);

            Assert.ThrowsException <Exception>(preveri);
        }
示例#6
0
        public void DvojnoTankanje()
        {
            Vozilo testno = new Vozilo(60, 5);

            double[] pot     = new double[] { 100, 50, 0, 0, 500, 0, 20 };
            Action   preveri = () => testno.Prevozi(pot);

            Assert.ThrowsException <Exception>(preveri);
        }
示例#7
0
        public void NegativnaPot()
        {
            Vozilo testno = new Vozilo(60, 5);

            double[] pot     = new double[] { 100, 50, 0, -5, 0, 500, 0, 20 };
            Action   preveri = () => testno.Prevozi(pot);

            Assert.ThrowsException <Exception>(preveri);
        }