Exemplo n.º 1
0
        public void Depozit_Nula()
        {
            //Arrange
            Bankomat b = new Bankomat();

            //Act & Assert
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => b.Depozit(0));
        }
Exemplo n.º 2
0
 public Task UrediBankomat(Bankomat bankomat)
 {
     if (nivoPristupa != 1)
     {
         throw new AuthenticationException();
     }
     return(filijaleBankomati.UrediBankomat(bankomat));
 }
Exemplo n.º 3
0
        public void Depozit_PozIznos(int pocetnoStanje, uint depozit)
        {
            //Arrange
            int      ocekivano = (int)(pocetnoStanje + depozit);
            Bankomat b         = new Bankomat();

            b.Stanje = pocetnoStanje;

            //Act
            b.Depozit(depozit);

            //Assert
            Assert.AreEqual(ocekivano, b.Stanje);
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            #region
            //  GetMyDelegate(Test, Test2);
            //  SetOneStr setOneStr = new SetOneStr(Hey);
            //  setOneStr += How;
            //  setOneStr("Nizami");

            ////SetOneStr setOneSTR = delegate (string str)
            //  SetOneStr setOneSTR = str =>
            //  {
            //     Console.WriteLine($"Good Bye {str}");
            //  };
            //  setOneSTR+=  Hey;
            //  setOneSTR += How;
            //  setOneSTR("Fizuli");
            //  //getFullName burda bir vareybl-dir.

            //  Console.WriteLine("\n");
            //  Student student = new Student();
            //  FullInfo fullInfo = student.getFullName;
            //  //fullInfo += delegate (string name, string surname, int age)
            //  fullInfo += (name,surname,age) =>
            //  {
            //      Console.WriteLine($" Best of Students Info {name} {surname} {age}");
            //  };
            //  fullInfo("Rehim","Abbasov",15);

            //  Temporary temporary = new Temporary();
            //  temporary.Test3();

            //Action<string> info = Test;
            //info += Test2;
            //info += str =>
            //{
            //    Console.WriteLine($"Teacher of P111 {str}");
            //};
            ////info("Kamran");
            //Func<int, string, string> func = SimpleFunc;
            ////Console.WriteLine(func(14,"Kamil"));
            #endregion
            Bankomat bankomat = new Bankomat(580);
            bankomat.CheckInfo += delegate(double hes, int x)
            {
                Console.WriteLine($"");
            };
        }
        public async Task <IActionResult> Create([Bind("Ime,Adresa")] Bankomat bankomat)
        {
            korisnik = await LoginUtils.Authenticate(Request, Context, this);

            if (korisnik == null)
            {
                return(RedirectToAction("Logout", "Login", new { area = "" }));
            }

            _filijaleBankomati.Pristupi(korisnik);
            ViewData["Ime"] = korisnik.Ime;
            if (ModelState.IsValid)
            {
                await _filijaleBankomati.DodajBankomat(bankomat);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(bankomat));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Ime,Adresa")] Bankomat bankomat)
        {
            korisnik = await LoginUtils.Authenticate(Request, Context, this);

            if (korisnik == null)
            {
                return(RedirectToAction("Logout", "Login", new { area = "" }));
            }

            _filijaleBankomati.Pristupi(korisnik);
            ViewData["Ime"] = korisnik.Ime;

            if (id != bankomat.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    await _filijaleBankomati.UrediBankomat(bankomat);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BankomatExists(bankomat.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(bankomat));
        }
Exemplo n.º 7
0
        public async Task <Bankomat> DajBankomat(int?id)
        {
            Bankomat bankomat = await _context.Bankomat.Include("Adresa").Where(m => m.Id == id).FirstAsync();

            return(bankomat);
        }
Exemplo n.º 8
0
 public async Task UrediBankomat(Bankomat bankomat)
 {
     _context.Update(bankomat);
     await _context.SaveChangesAsync();
 }
Exemplo n.º 9
0
 public async Task DodajBankomat(Bankomat bankomat)
 {
     _context.Add(bankomat);
     await _context.SaveChangesAsync();
 }
        public Bankomat NapraviBankomat(String ime, Adresa adresa)
        {
            Bankomat bankomat = new Bankomat(ime, adresa);

            return(bankomat);
        }