public void ShouldBeInvalidWhenSearchingTooShortRegEx() { var searchRequest = new SearchRequest(".", true); var result = searchRequest.BuildMessage(); result.IsValid.Should().BeFalse(); result.Message.Should().Be("Regex must be at least 2 characters"); }
public void ShouldBeInvalidWhenPlainTextExclusionTextIsTooShort() { var searchRequest = new SearchRequest("-f", false); var result = searchRequest.BuildMessage(); result.IsValid.Should().BeFalse(); result.Message.Should().Be("Text must be at least 3 characters"); }
public void ShouldBeInvalidWhenSearchingIrregularRegEx() { var searchRequest = new SearchRequest("[inf", true); var result = searchRequest.BuildMessage(); result.IsValid.Should().BeFalse(); result.Message.Should().Be("Invalid regular expression"); }
public void ShouldBeInvalidWhenPlainTextContainsOnlyWhiteSpaces() { var searchRequest = new SearchRequest("- \t", false); var result = searchRequest.BuildMessage(); result.IsValid.Should().BeFalse(); result.Message.Should().Be("Text contains illegal characters"); }
public void ShouldBeInvalidWhenPlainTextContainsIllegalCharacter() { var searchRequest = new SearchRequest(@"[i\nf", false); var result = searchRequest.BuildMessage(); result.IsValid.Should().BeFalse(); result.Message.Should().Be("Text contains illegal characters"); }
public void ShouldAskForTextWhenTextIsEmpty() { var searchRequest = new SearchRequest("", false); var result = searchRequest.BuildMessage(); result.IsValid.Should().BeTrue(); result.Message.Should().Be("Type to search using plain text"); }
public void ShouldAskForTextWhenRegexIsEmpty() { var searchRequest = new SearchRequest("", true); var result = searchRequest.BuildMessage(); result.IsValid.Should().BeTrue(); result.Message.Should().Be("Type to search using regex"); }
public void ShouldBeValidWhenSearchingAValidRegex() { var searchRequest = new SearchRequest("[inf]", true); var result = searchRequest.BuildMessage(); result.IsValid.Should().BeTrue(); result.Message.Should().Be("Hit enter to search using regex"); }
public void ShouldBeValidWhenSearchingPlainTextExclusion() { var searchRequest = new SearchRequest("-[inf", false); var result = searchRequest.BuildMessage(); result.IsValid.Should().BeTrue(); result.Message.Should().Be("Hit enter to search using plain text"); }