public void StartRecording_Where_PsrIsRunning_Expected_InvalidOperationException() { FeedbackRecorder recorder = new FeedbackRecorder(); string outputPath = GetUniqueOutputPath(); recorder.StartRecording(outputPath); recorder.StartRecording(outputPath); recorder.KillAllRecordingTasks(); }
public void StartRecording_Where_OutputPathIsntZipOrXml_Expected_InvalidOperationException() { string outputPath = GetUniqueOutputPath(".cake"); FeedbackRecorder recorder = new FeedbackRecorder(); recorder.StartRecording(outputPath); recorder.KillAllRecordingTasks(); }
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(); }
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(); }
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(); }
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!"); } }