public void NoAdditionalLinks() { var cmd = new Cmd.Links(); InitCommand(cmd); _context.CurrentItem = _nolinks; var result = cmd.Run(); Assert.That(result.Status, Is.EqualTo(CommandStatus.Success)); // Even with no added links, the item will link to it's template Assert.That(result.Message, Contains.Substring(Constants.Paths.DocTemplate)); }
public void IncomingAndOutgoing_ShowIncomingOnly() { var cmd = new Cmd.Links(); InitCommand(cmd); _context.CurrentItem = _inoutlink; cmd.ShowIncomingLinks = true; var result = cmd.Run(); Assert.That(result.Status, Is.EqualTo(CommandStatus.Success)); Assert.That(result.Message, Is.Not.Contains(" out ")); Assert.That(result.Message, Contains.Substring(_outlink.Paths.FullPath)); }
public void OutgoingLink_Absolute() { var cmd = new Cmd.Links(); InitCommand(cmd); _context.CurrentItem = _testRoot; cmd.ShowOutgoingLinks = true; cmd.Path = _outlink.Paths.FullPath; var result = cmd.Run(); Assert.That(result.Status, Is.EqualTo(CommandStatus.Success)); // Even with no added links, the item will link to it's template Assert.That(result.Message, Contains.Substring(Constants.Paths.DocTemplate)); Assert.That(result.Message, Contains.Substring(_inlink.Paths.FullPath)); }
public void OutgoingLink_IdList() { var cmd = new Cmd.Links(); InitCommand(cmd); _context.CurrentItem = _outlink; cmd.ShowOutgoingLinks = true; cmd.OutputIds = true; var result = cmd.Run(); Assert.That(result.Status, Is.EqualTo(CommandStatus.Success)); Assert.That(result.Message, Is.Not.Contains(_inlink.Paths.FullPath)); Assert.That(result.Message, Contains.Substring(_inlink.ID.ToString())); }
public void SourceField() { var cmd = new Cmd.Links(); InitCommand(cmd); _context.CurrentItem = _inlink; cmd.OriginFieldName = "text"; var result = cmd.Run(); Assert.That(result.Status, Is.EqualTo(CommandStatus.Success)); // Even with no added links, the item will link to it's template Assert.That(result.Message, Is.Not.Contains(Constants.Paths.DocTemplate)); Assert.That(result.Message, Contains.Substring(_outlink.Paths.FullPath)); }
public void IncomingAndOutgoing_ShowOutgoingOnly() { var cmd = new Cmd.Links(); InitCommand(cmd); _context.CurrentItem = _inoutlink; cmd.ShowOutgoingLinks = true; var result = cmd.Run(); Assert.That(result.Status, Is.EqualTo(CommandStatus.Success)); // Even with no added links, the item will link to it's template Assert.That(result.Message, Contains.Substring(Constants.Paths.DocTemplate)); Assert.That(result.Message, Is.Not.Contains(" in ")); Assert.That(result.Message, Contains.Substring(_inlink.Paths.FullPath)); }