예제 #1
0
        public void StartRecording_Where_OutputPathIsntZipOrXml_Expected_InvalidOperationException()
        {
            string outputPath = GetUniqueOutputPath(".cake");

            FeedbackRecorder recorder = new FeedbackRecorder();

            recorder.StartRecording(outputPath);
            recorder.KillAllRecordingTasks();
        }
예제 #2
0
        public void StartRecording_Where_PsrIsRunning_Expected_InvalidOperationException()
        {
            FeedbackRecorder recorder   = new FeedbackRecorder();
            string           outputPath = GetUniqueOutputPath();

            recorder.StartRecording(outputPath);
            recorder.StartRecording(outputPath);
            recorder.KillAllRecordingTasks();
        }
예제 #3
0
        public void StartRecording_Where_OutputPathDoesntExist_Expected_PathCreated()
        {
            FileInfo tmpOutputPath   = new FileInfo(GetUniqueOutputPath());
            string   newOutputFolder = Path.Combine(tmpOutputPath.Directory.FullName, Guid.NewGuid().ToString());
            string   newOutputpath   = Path.Combine(newOutputFolder, tmpOutputPath.Name);

            FeedbackRecorder recorder = new FeedbackRecorder();

            recorder.StartRecording(newOutputpath);
            Assert.AreEqual(Directory.Exists(newOutputFolder), true);
            recorder.KillAllRecordingTasks();
        }
예제 #4
0
        public void StartRecording_Where_OutputPathAlreadyExists_Expected_FileIOException()
        {
            //Create file which is to conflict with the output path of the recorder
            FileInfo conflictingPath = new FileInfo(GetUniqueOutputPath());

            conflictingPath.Create().Close();

            FeedbackRecorder recorder   = new FeedbackRecorder();
            string           outputPath = conflictingPath.FullName;

            recorder.StartRecording(outputPath);
            recorder.KillAllRecordingTasks();
        }
예제 #5
0
        public void StartRecording_Where_PsrIsntRunningAndOutputPathValid_Expected_ProcessStarts()
        {
            var    recorder   = new FeedbackRecorder();
            string outputPath = GetUniqueOutputPath();

            recorder.StartRecording(outputPath);

            if (!CheckIfProcessIsRunning())
            {
                Assert.Fail("Recording process failed to start!");
            }
            recorder.KillAllRecordingTasks();
        }
예제 #6
0
        public void KillAllRecordingTasks_Expected_NoRecordinProcessesLeft()
        {
            FeedbackRecorder recorder   = new FeedbackRecorder();
            string           outputPath = GetUniqueOutputPath();

            recorder.StartRecording(outputPath);
            recorder.KillAllRecordingTasks();

            while (CheckIfProcessIsRunning())
            {
                EnsureProcessIsntRunning(false);
            }

            if (CheckIfProcessIsRunning())
            {
                Assert.Fail("Failed to kill all running recording processes!");
            }
        }
예제 #7
0
        public void IsRecorderAvailable_Where_RecorderAvailable_Expected_False()
        {
            FeedbackRecorder recorder = new FeedbackRecorder(p => false);

            Assert.IsFalse(recorder.IsRecorderAvailable);
        }
예제 #8
0
        public void IsRecorderAvailable_Where_RecorderAvailable_Expected_True()
        {
            FeedbackRecorder recorder = new FeedbackRecorder(p => true);

            Assert.IsTrue(recorder.IsRecorderAvailable);
        }
예제 #9
0
        public void StopRecording_Where_PsrIsntRunning_Expected_NoException()
        {
            FeedbackRecorder recorder = new FeedbackRecorder();

            recorder.StopRecording();
        }
예제 #10
0
 public void Construction_Where_FileExistsFunctionIsNull_Expected_ArgumentNullException()
 {
     FeedbackRecorder recorder = new FeedbackRecorder(null);
 }