public void TearDown()
        {
            _model.Dispose();
            _model = null;

            _tempFolder.Dispose();
            _tempFolder = null;
        }
        public void SetUp()
        {
            // The next two lines create a Synchronization context so that WaveIn can be happy.
            var someControl = new Control();
            var whatever    = someControl.Handle;

            _model = new SessionRecorderDlgViewModel();
            _model.Recorder.BeginMonitoring();
            _tempFolder = new TemporaryFolder("SessionRecorderDlgViewModelTests");
            Assert.IsFalse(_model.IsRecording);
            Assert.IsFalse(_model.IsPlaying);
            Assert.IsFalse(_model.CanPlay);
            Assert.IsTrue(_model.CanRecordNow);

            _session = new Mock <Session>();
            _session.Setup(e => e.FolderPath).Returns(_tempFolder.Path);
            _session.Setup(e => e.Id).Returns("Tom");
        }
Beispiel #3
0
        /// ------------------------------------------------------------------------------------
        private void HandleButtonNewFromRecordingsClick(object sender, EventArgs e)
        {
            if (!AudioUtils.GetCanRecordAudio())
            {
                return;
            }

            using (var viewModel = new SessionRecorderDlgViewModel())
                using (var dlg = new SessionRecorderDlg(viewModel))
                {
                    if (dlg.ShowDialog(FindForm()) != DialogResult.OK)
                    {
                        return;
                    }

                    var newSession = _model.CreateNewElement();
                    viewModel.MoveRecordingToSessionFolder(newSession);
                    LoadElementList(newSession);

                    SetFocusOnId();
                }
        }