Exemplo n.º 1
0
        public void StartRecording_Where_PsrIsRunning_Expected_InvalidOperationException()
        {
            FeedbackRecorder recorder   = new FeedbackRecorder();
            string           outputPath = GetUniqueOutputPath();

            recorder.StartRecording(outputPath);
            recorder.StartRecording(outputPath);
            recorder.KillAllRecordingTasks();
        }
Exemplo n.º 2
0
        public void StartRecording_Where_OutputPathIsntZipOrXml_Expected_InvalidOperationException()
        {
            string outputPath = GetUniqueOutputPath(".cake");

            FeedbackRecorder recorder = new FeedbackRecorder();

            recorder.StartRecording(outputPath);
            recorder.KillAllRecordingTasks();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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!");
            }
        }