Пример #1
0
        public void FirstScheduleItemSelected()
        {
            Schedule schedule           = BaseSchedule.Build();
            SchedulePageViewModel model = CreateViewModel(schedule);

            Assert.NotNull(model.ItemViewModel);
        }
Пример #2
0
        public void PrevFromFirstItemNotAllowed()
        {
            Schedule schedule           = BaseSchedule.Build();
            SchedulePageViewModel model = CreateViewModel(schedule);

            Assert.False(model.PreviousCommand.CanExecute(null));
        }
Пример #3
0
        public void NextFromLastItemFinishes()
        {
            Schedule schedule           = BaseSchedule.Build();
            SchedulePageViewModel model = CreateViewModel(schedule);

            model.NextCommand.Execute(null);

            Assert.Raises <EventArgs>(
                attach: handler => model.ScheduleFinished += handler,
                detach: handler => model.ScheduleFinished -= handler,
                testCode: () => model.NextCommand.Execute(null)
                );
        }
Пример #4
0
        public void RetryRecording()
        {
            Schedule schedule           = BaseSchedule.Build();
            SchedulePageViewModel model = CreateViewModel(schedule);

            model.RecordCommand.Execute(null); // start
            Assert.Equal(ScheduleItemStateType.Recording, model.DisplayState);

            model.RecordCommand.Execute(null); // stop
            Assert.Equal(ScheduleItemStateType.Finish, model.DisplayState);

            model.RetryCommand.Execute(null);
            Assert.Equal(ScheduleItemStateType.Start, model.DisplayState);
            Assert.True(model.ShowRecordButton, "Record button should show");
        }