Skip to content

Conversation

@kzrnm
Copy link
Contributor

@kzrnm kzrnm commented Nov 23, 2020

Visual Studio 2019 supports regex syntax highlighting of System.Text.RegularExpressions.Regex.

https://devblogs.microsoft.com/dotnet/visual-studio-2019-net-productivity/#regex-language-support

image

I want overloads of StringAssertions.MatchRegex and StringAssertions.NotMatchRegex that take System.Text.RegularExpressions.Regex.

IMPORTANT

  • The code complies with the Coding Guidelines for C#.
  • The changes are covered by a new or existing set of unit tests which follow the Arrange-Act-Assert syntax such as is used in this example.
  • If the contribution adds a feature or fixes a bug, please update the release notes, which are published on the website.
  • If the contribution changes the public API the changes needs to be included by running AcceptApiChanges.ps1/AcceptApiChanges.sh.
  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.

@kzrnm
Copy link
Contributor Author

kzrnm commented Nov 23, 2020

  • When_a_string_is_matched_against_an_invalid_regex_it_should_throw_with_a_clear_explanation
  • When_a_string_is_matched_against_an_invalid_regex_it_should_only_have_one_failure_message
  • When_a_string_is_negatively_matched_against_an_invalid_regex_it_should_throw_with_a_clear_explanation
  • When_a_string_is_negatively_matched_against_an_invalid_regex_it_only_contain_one_failure_message

I didn't write these test bacause new System.Text.RegularExpressions.Regex(".**") throws ArgumentException.

@kzrnm kzrnm marked this pull request as ready for review November 23, 2020 10:12
@dennisdoomen dennisdoomen changed the title add overloads of MatchRegex and NotMatchRegex that take System.Text.RegularExpressions.Regex Add overloads of MatchRegex and NotMatchRegex that take System.Text.RegularExpressions.Regex Nov 23, 2020
@dennisdoomen
Copy link
Member

Visual Studio 2019 supports regex syntax highlighting of System.Text.RegularExpressions.Regex.

FYI, Jetbrains Rider also allows you to do that with string literals.

@kzrnm
Copy link
Contributor Author

kzrnm commented Nov 23, 2020

@dennisdoomen Thank you for your review. I have updated string regularExpression overloads and releases.md.

@dennisdoomen dennisdoomen requested a review from jnyrup November 23, 2020 15:51
@dennisdoomen dennisdoomen merged commit cfe930f into fluentassertions:develop Nov 24, 2020
@kzrnm kzrnm deleted the feature/regex_overloads branch November 24, 2020 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants