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); }
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); }
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); }