public void ContextVersion() { var cmd = new Cmd.DeleteVersions(); InitCommand(cmd); _context.CurrentItem = _testItem.Database.GetItem(_testItem.ID, Language.Parse("en"), new Version(3)); var result = cmd.Run(); Assert.That(result.Status, Is.EqualTo(CommandStatus.Success)); AssertVersionNumbers(new[] { 1, 2, 4 }, new[] { 1, 2, 3, 4, 5 }, 4); }
public void DifferentPath() { var cmd = new Cmd.DeleteVersions(); InitCommand(cmd); _context.CurrentItem = _testItem.Parent.Parent; cmd.Path = _testItem.Parent.Name + "/" + _testItem.Name; var result = cmd.Run(); Assert.That(result.Status, Is.EqualTo(CommandStatus.Success)); AssertVersionNumbers(new[] { 1, 2, 3 }, new[] { 1, 2, 3, 4, 5 }, 1); }
public void ContextVersionLatest() { var cmd = new Cmd.DeleteVersions(); InitCommand(cmd); _context.CurrentItem = _testItem; var result = cmd.Run(); Assert.That(result.Status, Is.EqualTo(CommandStatus.Success)); AssertVersionNumbers(new[] { 1, 2, 3 }, new[] { 1, 2, 3, 4, 5 }, 3); }
public void AllLanguagesAndOtherVerions() { var cmd = new Cmd.DeleteVersions(); InitCommand(cmd); _context.CurrentItem = _testItem; cmd.Path = "::3"; cmd.OtherVersions = true; cmd.AllLanguages = true; var result = cmd.Run(); Assert.That(result.Status, Is.EqualTo(CommandStatus.Success)); AssertVersionNumbers(new[] { 3 }, new[] { 3 }, 3); }
public void VersionInPath() { var cmd = new Cmd.DeleteVersions(); InitCommand(cmd); _context.CurrentItem = _testItem; cmd.Path = "::2"; var result = cmd.Run(); Assert.That(result.Status, Is.EqualTo(CommandStatus.Success)); AssertVersionNumbers(new[] { 1, 3, 4 }, new[] { 1, 2, 3, 4, 5 }, 4); }