Exemplo n.º 1
0
        public void OptionWorkflow_CompareTo()
        {
            var expectedGuid         = Guid.NewGuid();
            var expectedWorkflowName = "WorkflowName";
            var expectedInputs       = new List <IServiceInputBase>();
            var workflow             = new WorkflowWithInputs
            {
                Name   = expectedWorkflowName,
                Value  = expectedGuid,
                Inputs = expectedInputs,
            };
            var optionWorkflow = new OptionWorkflow
            {
                Name     = "Suggestions",
                Workflow = workflow,
            };

            var expectedValue = optionWorkflow.CompareTo(null);

            Assert.AreEqual(-1, expectedValue);

            expectedValue = optionWorkflow.CompareTo(new object { });
            Assert.AreEqual(-1, expectedValue);

            expectedValue = optionWorkflow.CompareTo(optionWorkflow);
            Assert.AreEqual(0, expectedValue);
        }
Exemplo n.º 2
0
        public void OptionWorkflow_Default()
        {
            var optionWorkflow = new OptionWorkflow();

            Assert.IsNull(optionWorkflow.Name);
            Assert.IsNull(optionWorkflow.Workflow);

            optionWorkflow.Name = "Name";
            Assert.AreEqual("Name", optionWorkflow.Name);

            var expectedGuid         = Guid.NewGuid();
            var expectedWorkflowName = "WorkflowName";
            var expectedInputs       = new List <IServiceInputBase>();
            var workflow             = new WorkflowWithInputs
            {
                Name   = expectedWorkflowName,
                Value  = expectedGuid,
                Inputs = expectedInputs,
            };

            optionWorkflow.Workflow = workflow;
            Assert.AreEqual(expectedWorkflowName, optionWorkflow.Workflow.Name);
            Assert.AreEqual(expectedGuid, optionWorkflow.Workflow.Value);
            Assert.IsNotNull(optionWorkflow.Workflow.Inputs);

            Assert.AreEqual("OptionWorkflowHelpText", optionWorkflow.HelpText);
            Assert.AreEqual("OptionWorkflowTooltip", optionWorkflow.Tooltip);
        }
Exemplo n.º 3
0
        public void OptionWorkflow_Clone()
        {
            var expectedGuid         = Guid.NewGuid();
            var expectedWorkflowName = "WorkflowName";
            var expectedInputs       = new List <IServiceInputBase>();
            var workflow             = new WorkflowWithInputs
            {
                Name   = expectedWorkflowName,
                Value  = expectedGuid,
                Inputs = expectedInputs,
            };
            var optionWorkflow = new OptionWorkflow
            {
                Name     = "Suggestions",
                Workflow = workflow,
            };

            var cloneWorkflow = optionWorkflow.Clone() as OptionWorkflow;

            Assert.AreEqual(optionWorkflow.Name, cloneWorkflow.Name);
            Assert.AreEqual(optionWorkflow.Workflow, cloneWorkflow.Workflow);
        }