예제 #1
0
    public void SingelItemFromContext()
    {
      var cmd = new Cmd.GetItem();
      base.InitCommand(cmd);

      _context.CurrentItem = _contentRoot;

      var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Success));
      Assert.That(result.Message, Contains.Substring("<item"));
      Assert.That(result.Message, Contains.Substring("</item>"));
      Assert.That(result.Message, Contains.Substring("key=\"items\""));
      Assert.That(result.Message, Is.Not.ContainsSubstring("key=\"neso\""));
    }
예제 #2
0
    public void RecursiveItemFromContext()
    {
      var cmd = new Cmd.GetItem();
      base.InitCommand(cmd);

      _context.CurrentItem = _contentRoot.Axes.GetChild("proteus");
      cmd.Recursive = true;

      var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Success));
      Assert.That(result.Message, Contains.Substring("<item"));
      Assert.That(result.Message, Contains.Substring("</item>"));
      Assert.That(result.Message, Contains.Substring("key=\"proteus\""));
      Assert.That(result.Message, Contains.Substring("key=\"child1\""));
      Assert.That(result.Message, Contains.Substring("key=\"child2\""));
    }