コード例 #1
0
ファイル: TestMainViewModel.cs プロジェクト: Bappy1988/OnlyR
        public void NavToOptionsPage()
        {
            MainViewModel vm = CreateMainViewModel();

            RecordingPageViewModel rvm = (RecordingPageViewModel)vm.CurrentPage.DataContext;

            rvm.NavigateSettingsCommand.Execute(null);

            Assert.IsTrue(vm.CurrentPage is Pages.SettingsPage);
        }
コード例 #2
0
        public void NavToRecordingPage()
        {
            MainViewModel vm = CreateMainViewModel();

            RecordingPageViewModel rvm = (RecordingPageViewModel)vm.CurrentPage.DataContext;

            rvm.NavigateSettingsCommand.Execute(null);

            // ReSharper disable once PossibleInvalidCastException
            SettingsPageViewModel svm = (SettingsPageViewModel)vm.CurrentPage.DataContext;

            svm.NavigateRecordingCommand.Execute(null);

            Assert.IsTrue(vm.CurrentPage is Pages.RecordingPage);
        }
コード例 #3
0
        public void StartRecording()
        {
            MainViewModel vm = CreateMainViewModel();

            RecordingPageViewModel rvm = (RecordingPageViewModel)vm.CurrentPage.DataContext;

            Assert.IsTrue(rvm.RecordingStatus == RecordingStatus.NotRecording);

            Assert.AreEqual(rvm.ElapsedTimeStr, TimeSpan.Zero.ToString("hh\\:mm\\:ss"));
            rvm.StartRecordingCommand.Execute(null);

            Assert.IsTrue(rvm.RecordingStatus == RecordingStatus.Recording);

            rvm.StopRecordingCommand.Execute(null);
            Assert.IsTrue(rvm.RecordingStatus == RecordingStatus.NotRecording);
        }