Beispiel #1
0
        private OperationDuplex <T>[] GetArrayFromCurrentTasks()
        {
            var array = new OperationDuplex <T> [WorkflowBuilder.Tasks.Tasks.Count];

            WorkflowBuilder.Tasks.Tasks.CopyTo(array, 0);
            return(array);
        }
        public void ShouldAddConstraintToRegisteredOperations()
        {
            var constraint = If.IsTrue(true);

            _pipe.Do(new Func <string, string>((b) => "true"), constraint);

            Assert.That(1 == _pipe.RegisteredOperations.Tasks.Count, "Operation count");
            OperationDuplex <string> operation = _pipe.RegisteredOperations.Tasks[0];
        }
Beispiel #3
0
        public void ShouldReturnUnsuccessfull()
        {
            var engine    = new Dispatcher <string>();
            var operation = new FailedOperation();

            var operationWrapper =
                new OperationDuplex <string>(new OperationInvoker <string>(operation));

            engine.Execute(operationWrapper);

            Assert.That(operation.SuccessResult, Is.EqualTo(false));
        }
        public void ShouldUseExecutionEngine()
        {
            var operation =
                new OperationDuplex<string>(new FunctionInvoker<string>(r => "1"));

            _taskList.Tasks.Add(operation);
            _engine.Setup(e => e.Execute(_taskList.Tasks)).Returns("1");

            _workflow.Start();

            _engine.VerifyAll();
        }
        public void ShouldUseExecutionEngine()
        {
            var operation =
                new OperationDuplex <string>(new FunctionInvoker <string>(r => "1"));

            _taskList.Tasks.Add(operation);
            _engine.Setup(e => e.Execute(_taskList.Tasks)).Returns("1");

            _workflow.Start();

            _engine.VerifyAll();
        }
 public void ShouldReturnTrueForEqualOperations()
 {
     var operationDuplex = new OperationDuplex<Colour>(new OperationInvoker<Colour>(_operation));
     operationDuplex.Command.ShouldEqual(_operation);
 }
 public void ShouldReturnFalseForUnequalOperations()
 {
     var operationDuplex = new OperationDuplex<Colour>(new OperationInvoker<Colour>(_operation));
     operationDuplex.Command.ShouldNotEqual(new DoubleSpace());
 }
        public void ShouldReturnFalseForUnequalOperations()
        {
            var operationDuplex = new OperationDuplex <Colour>(new OperationInvoker <Colour>(_operation));

            operationDuplex.Command.ShouldNotEqual(new DoubleSpace());
        }
        public void ShouldReturnTrueForEqualOperations()
        {
            var operationDuplex = new OperationDuplex <Colour>(new OperationInvoker <Colour>(_operation));

            operationDuplex.Command.ShouldEqual(_operation);
        }