示例#1
0
    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"));
    }
示例#2
0
    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);
    }
示例#3
0
    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]);
    }
示例#4
0
    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);
    }
示例#5
0
    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);
    }