Example #1
0
        public void SplineReticulator_throws_exception_if_coordinateType_is_NullOrEmpty()
        {
            Exception result1 = new Exception();

            try
            {
                var task = new SplineReticulator(null);
            }
            catch (Exception ex)
            {
                result1 = ex;
            }
            Exception result2 = new Exception();

            try
            {
                var task = new SplineReticulator("");
            }
            catch (Exception ex)
            {
                result2 = ex;
            }

            result1.Should().BeOfType <NullReferenceException>();
            result1.Message.Should().Contain("coordinateType must be " +
                                             "defined for splines to be reticulated.");
            result2.Should().BeOfType <NullReferenceException>();
            result2.Message.Should().Contain("coordinateType must be " +
                                             "defined for splines to be reticulated.");
        }
Example #2
0
        public void Workflow_Add_adds_IExecutable_to_taskList()
        {
            var work = new Workflow();
            var task = new SplineReticulator("curvilinear");

            work.Add(task);
            var result = work.GetTaskList();

            result.Should().Contain(task);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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");
        }