Esempio n. 1
0
        public static StartedWashCost CreateStartedWashCost(Reservation reservation, MachineProgram machineProgram)
        {
            StartedWashCost cost = new StartedWashCost();

            cost.MachineProgram1 = machineProgram;

            reservation.StartedWashCosts.Add(cost);
            Db.StartedWashCosts.Add(cost);
            Db.SaveChanges();
            return(cost);
        }
Esempio n. 2
0
        public void TestUnPaidWashes1()
        {
            reservation.reservationUsed = true;
            StartedWashCost start1  = new StartedWashCost();
            MachineProgram  program = new MachineProgram();

            start1.MachineProgram1 = program;
            program.price          = 10;

            reservation.StartedWashCosts.Add(start1);


            StartedWashCost start2 = new StartedWashCost();

            start2.MachineProgram1 = program;

            reservation.StartedWashCosts.Add(start2);


            Assert.AreEqual(20, laundryUser.UnPaidWashes());
        }
Esempio n. 3
0
        public void TestFindStartedWash()
        {
            reservation.reservationUsed = true;
            StartedWashCost start1 = new StartedWashCost();

            start1.id = 1;
            MachineProgram program1 = new MachineProgram();
            MachineProgram program2 = new MachineProgram();

            start1.MachineProgram1 = program1;
            program1.price         = 10;
            program2.price         = 12;
            reservation.StartedWashCosts.Add(start1);


            StartedWashCost start2 = new StartedWashCost();

            start2.MachineProgram1 = program2;
            start2.payed           = true;
            start2.id = 2;
            reservation.StartedWashCosts.Add(start2);

            Assert.AreEqual(start1.id, reservation.findStartedWash(program1).id);
        }