Пример #1
0
    public void InvalidDatabase()
    {
      var cmd = new Cmd.ListPublishQueue();
      InitCommand(cmd);
      cmd.DatabaseName = "blah";

      var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Failure));
    }
Пример #2
0
    public void EarlyDateFilter()
    {
      var cmd = new Cmd.ListPublishQueue();
      InitCommand(cmd);
      cmd.ToDate = new DateTime(1970, 1, 1);
      cmd.NoStats = true;

      var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Success));
      Assert.That(result.Message, Is.Empty);
    }
Пример #3
0
    public void _1Update()
    {
      var fromDate = DateTime.Now;
      var update1 = _testRoot.Add("update1", _template);

      var cmd = new Cmd.ListPublishQueue();
      InitCommand(cmd);
      cmd.FromDate = fromDate;

      var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Success));
      Assert.That(result.Message, Contains.Substring("1 item found"));
      Assert.That(result.Message, Contains.Substring(update1.Paths.FullPath));
    }
Пример #4
0
    public void _3Updates()
    {
      var fromDate = DateTime.Now;
      Thread.Sleep(300);
      var update2 = _testRoot.Add("update2", _template);
      var update3 = _testRoot.Add("update3", _template);
      var update4 = _testRoot.Add("update4", _template);

      var cmd = new Cmd.ListPublishQueue();
      InitCommand(cmd);
      cmd.FromDate = fromDate;

      var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Success));
      Assert.That(result.Message, Contains.Substring("3 items found"));
      Assert.That(result.Message, Contains.Substring(update2.Paths.FullPath));
      Assert.That(result.Message, Contains.Substring(update3.Paths.FullPath));
      Assert.That(result.Message, Contains.Substring(update4.Paths.FullPath));
    }
Пример #5
0
    public void _3UpdatesDateFilter()
    {
      var update5 = _testRoot.Add("update5", _template);
      Thread.Sleep(300);
      var fromDate = DateTime.Now;
      var update6 = _testRoot.Add("update6", _template);
      var update7 = _testRoot.Add("update7", _template);

      var cmd = new Cmd.ListPublishQueue();
      InitCommand(cmd);
      cmd.FromDate = fromDate;

      var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Success));
      Assert.That(result.Message, Contains.Substring("2 items found"));
      Assert.That(result.Message, Contains.Substring(update6.ID.ToString()));
      Assert.That(result.Message, Contains.Substring(update7.ID.ToString()));
    }