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)); }
public void EmptyInput() { var cmd = new Cmd.RegexMatch(); InitCommand(cmd); cmd.Regex = ".*"; var result = cmd.Run(); Assert.That(result.Status, Is.EqualTo(CommandStatus.Success)); }
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); }
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); }