Skip to content

Instantly share code, notes, and snippets.

@JamieHouston
Created June 30, 2017 21:03
Show Gist options
  • Save JamieHouston/c49b45ddc7053707346599e8d922effc to your computer and use it in GitHub Desktop.
Save JamieHouston/c49b45ddc7053707346599e8d922effc to your computer and use it in GitHub Desktop.
Update MSTest/NUnit to XUnit
%s/Assert\.AreEqual(\(.*\), \(.*\))/\1.Should().Be(\2)/g
%s/Assert\.IsTrue(\(.*\))/\1.Should().BeTrue()/g
%s/Assert\.IsFalse(\(.*\))/\1.Should().BeFalse()/g
%s/Assert\.IsNull(\(.*\))/\1.Should().BeNull()/g
%s/Assert\.IsNotNull(\(.*\))/\1.Should().NotBeNull()/g
@JamieHouston
Copy link
Author

%s/assertEquals((.), (.))/\1 shouldEqual \2/g
%s/assertTrue((.()))/\1 shouldBe true/g
%s/assertFalse((.
()))/\1 shouldBe false/g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment