public void VirtualAudioMode_throws_exception_if_mode_is_NullOrEmpty() { Exception result1 = new Exception(); try { var task = new VirtualAudioMode(null); } catch (Exception ex) { result1 = ex; } Exception result2 = new Exception(); try { var task = new VirtualAudioMode(""); } catch (Exception ex) { result2 = ex; } result1.Should().BeOfType <NullReferenceException>(); result1.Message.Should().Contain("Virtual audio mode must be defined"); result2.Should().BeOfType <NullReferenceException>(); result2.Message.Should().Contain("Virtual audio mode must be defined"); }
public void Workflow_Add_adds_multiple_IExecutables_to_taskList() { var work = new Workflow(); var task1 = new SplineReticulator("curvilinear"); var task2 = new VirtualAudioMode("Silent"); work.Add(task1); work.Add(task2); var result = work.GetTaskList(); result[0].Should().Be(task1); result[1].Should().Be(task2); }
public void Workflow_Remove_removes_task_from_taskList() { var work = new Workflow(); var task1 = new SplineReticulator("curvilinear"); work.Add(task1); var task2 = new VirtualAudioMode("Silent"); work.Add(task2); work.Remove(task2); var result = work.GetTaskList(); result.Should().NotContain(task2); result.Should().Contain(task1); }
static void Main(string[] args) { var work = new Workflow(); work.Add(new SplineReticulator("curvilinear")); work.Add(new VirtualAudioMode("silent")); work.Add(new VirtualAudioSystem()); var task = new VirtualAudioMode("invisible"); work.Add(task); work.LogContents(); work.Remove(task); WorkflowEngine.Run(work); work.LogContents(); }
public void Workflow_Remove_throws_exception_if_task_not_in_taskList() { var work = new Workflow(); var task1 = new SplineReticulator("curvilinear"); work.Add(task1); var task2 = new VirtualAudioMode("Silent"); Exception result = new Exception(); try { work.Remove(task2); } catch (Exception ex) { result = ex; } result.Should().BeOfType <NullReferenceException>(); result.Message.Should().Contain("Task is not in taskList"); }