Beispiel #1
0
        public void AddWeightTests(double vehicleWeight, double maxWeight, double[] loads)
        {
            VehicleWeightTracker tracker = new VehicleWeightTracker(vehicleWeight, maxWeight);

            foreach (double load in loads)
            {
                tracker.AddWeight(load);
            }

            Assert.True(tracker.TotalWeight <= tracker.MaxWeight);
        }
 public void AddLoad(double load) =>
 VehicleWeightTracker.AddWeight(load);
 public void AddPassenger(double passengerWeight)
 {
     VehicleWeightTracker.AddWeight(passengerWeight);
     PassengerTracker.AddPassenger();
 }
 public Vehicle(double vehicleWeight, double maxWeight, int passengersCapacity)
 {
     VehicleWeightTracker = new VehicleWeightTracker(vehicleWeight, maxWeight);
     PassengerTracker     = new PassengerTracker(passengersCapacity);
 }