Beispiel #1
0
    public void ValidateFields_FieldWithValidID_ReturnsSuccessMessage()
    {
      var cmd = new Cmd.ValidateFields();
      InitCommand(cmd);

      var goodItem = this.CreateTestItem("good item", "abc 123 xyz");
      cmd.Path = goodItem.Paths.FullPath;
      CommandResult result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Success));
      Assert.That(result.Message, Is.StringStarting("PASSED: Validation passed for"));
    }
Beispiel #2
0
    public void ValidateFields_FieldWithInvalidContent_ReturnsFailedMessage()
    {
      var cmd = new Cmd.ValidateFields();
      InitCommand(cmd);

      var badItem = this.CreateTestItem("bad item", "abc $ xyz");
      cmd.Path = badItem.Paths.FullPath;
      CommandResult result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Success));
      Assert.That(result.Message, new StartsWithConstraint("FAILED: Validation failed for"));
      Assert.That(result.Message, Contains.Substring("\"Alphanumeric characters and spaces only.\""));
    }