Esempio n. 1
0
    public void EmptyRegex()
    {
      var cmd = new Cmd.RegexMatch();
      InitCommand(cmd);

      cmd.Input = "I sat by the ocean";

      var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Failure));
    }
Esempio n. 2
0
    public void EmptyInput()
    {
      var cmd = new Cmd.RegexMatch();
      InitCommand(cmd);

      cmd.Regex = ".*";

      var result = cmd.Run();
      
      Assert.That(result.Status, Is.EqualTo(CommandStatus.Success));
    }
Esempio n. 3
0
    public void NoMatch()
    {
      var cmd = new Cmd.RegexMatch();
      InitCommand(cmd);

      cmd.Input = "I sat by the ocean";
      cmd.Regex = "moon";

      var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Success));
      Assert.That(result.Message, Is.Empty);
    }
Esempio n. 4
0
    public void NoMatch_CaseSensitive()
    {
      var cmd = new Cmd.RegexMatch();
      InitCommand(cmd);

      cmd.Input = "I sat by the Ocean";
      cmd.Regex = "\\socean";
      cmd.CaseSensitive = true;

      var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Success));
      Assert.That(result.Message, Is.Empty);
    }