Skip to content

Instantly share code, notes, and snippets.

@cnjimbo
Last active February 22, 2022 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cnjimbo/d2775e5b9e2df6b1c450a68892d1617d to your computer and use it in GitHub Desktop.
Save cnjimbo/d2775e5b9e2df6b1c450a68892d1617d to your computer and use it in GitHub Desktop.
Upgrade xunit assert to shouldly

change Equal to ShouldBe

from

Assert.Equal\(([^,]+), ([[]\w\d\(\)\.]+)\);

To

$2.ShouldBe($1);

switch the expect and actual

from

(^[ \t]*)(\"[:\D \w]+\").ShouldBe\(([\w\.\d\[\]]+)\);

to

$1$3.ShouldBe($2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment