public StartedWashCost findStartedWash(MachineProgram p) { StartedWashCost startedWashCost = null; foreach (var started in StartedWashCosts) { if (started.MachineProgram1.Equals(p)) { startedWashCost = started; } } return(startedWashCost); }
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); }
public void TestUnPaidWashes2() { 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; start2.payed = true; reservation.StartedWashCosts.Add(start2); Assert.AreEqual(10, laundryUser.UnPaidWashes()); }