예제 #1
0
        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));
            });
        }
예제 #2
0
        public void MeasurementOrderManagerAddNullId()
        {
            var manager = new MeasurementOrderManager();

            Assert.Throws <NullReferenceException>(() => manager.AddOrder(null));
        }
예제 #3
0
        public void MeasurementOrderManagerAddRepeatingId(MeasurementOrder order)
        {
            var manager = new MeasurementOrderManager();

            Assert.Throws <ArgumentException>(() => { manager.AddOrder(order); manager.AddOrder(order); });
        }