public void List_NoWorkflow() { var cmd = new Cmd.WorkflowCommand(); InitCommand(cmd); _context.CurrentItem = _noWorkflow; var result = cmd.Run(); Assert.AreEqual(CommandStatus.Success, result.Status); Assert.IsTrue(result.Message.Contains("No commands available")); }
public void List_CommandsAvailable() { var cmd = new Cmd.WorkflowCommand(); InitCommand(cmd); _context.CurrentItem = _itemInWorkflow; var result = cmd.Run(); Assert.AreEqual(CommandStatus.Success, result.Status); Assert.AreEqual("Submit\r\n__OnSave\r\n", result.Message); }
public void Execute_ValidCommand() { var cmd = new Cmd.WorkflowCommand(); InitCommand(cmd); cmd.Command = "submit"; _context.CurrentItem = _itemInWorkflow; var result = cmd.Run(); _itemInWorkflow.Reload(); Assert.AreEqual(CommandStatus.Success, result.Status); Assert.AreEqual("{46DA5376-10DC-4B66-B464-AFDAA29DE84F}", _itemInWorkflow[FieldIDs.WorkflowState]); }
public void Execute_NoWorkflow() { var cmd = new Cmd.WorkflowCommand(); InitCommand(cmd); cmd.Command = "submit"; _context.CurrentItem = _noWorkflow; var result = cmd.Run(); Assert.AreEqual(CommandStatus.Failure, result.Status); }
public void Execute_InvalidCommand() { var cmd = new Cmd.WorkflowCommand(); InitCommand(cmd); cmd.Command = "blah"; _context.CurrentItem = _itemInWorkflow; var result = cmd.Run(); Assert.AreEqual(CommandStatus.Failure, result.Status); }