Created
January 17, 2018 23:30
-
-
Save boekabart/8d4bc968685ef78dda2d8ddd97086f0d to your computer and use it in GitHub Desktop.
Regex find/replace pairs to migrate many common xUnit Assertions to FluentAssertions syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Assert\.NotNull\((.*)\); | |
$1.Should().NotBeNull(); | |
Assert\.Null\((.*)\); | |
$1.Should().BeNull(); | |
Assert\.Equal\(\s*(\d+)\s*,\s*(.*)\.Length\); | |
$2.Should().HaveCount($1); | |
Assert\.Equal\(\s*([^,]+)\s*,\s*(.*)\s*\); | |
$2.Should().Be($1); | |
Assert\.True\((.+)\.Any\((.*)\)\); | |
$1.Should().Contain($2); | |
Assert\.True\((.+)\); | |
$1.Should().BeTrue(); | |
Assert\.False\((.+)\); | |
$1.Should().BeFalse(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment