private void InitMeasurementsSchedule(MainViewModel model) { var randGen = new Random(); var orderManager = new MeasurementOrderManager(); var builder = new TwoHoursMeasurementScheduleListBuilder(); var scheduleList = builder .WithTownList(model.TownList.Select(m => m.Model)) .WithTotalDays(randGen.Next(1, 10)) .WithOrderManager(orderManager) .WithDateStartPoint(DateTime.Now) .EachIntervalMeasurmentsCount(() => { return(randGen.Next(0, 5)); }) .TimeIntervalsCount(() => { return(randGen.Next(0, 4)); }) .Build(); scheduleList.ForEach( s => { model.MeasurementScheduleList.Add(new MeasurementScheduleViewModel(s)); }); }
public void MeasurementOrderManagerAddNullId() { var manager = new MeasurementOrderManager(); Assert.Throws <NullReferenceException>(() => manager.AddOrder(null)); }
public void MeasurementOrderManagerAddRepeatingId(MeasurementOrder order) { var manager = new MeasurementOrderManager(); Assert.Throws <ArgumentException>(() => { manager.AddOrder(order); manager.AddOrder(order); }); }