Skip to content

Instantly share code, notes, and snippets.

@philippdolder
Created March 23, 2015 07:08
Show Gist options
  • Save philippdolder/38140c786a9384053bfd to your computer and use it in GitHub Desktop.
Save philippdolder/38140c786a9384053bfd to your computer and use it in GitHub Desktop.
R# SSP: MsTest to FluentAssertions collection count
The expression in the code looks like this:
var list = new List<string>();
Assert.AreEqual(3, list.Count);
Search part of ssp:
Assert.AreEqual($expected$, $actual$.Count);
both variables match "exactly one argument". I've turned on "Match similar constructs"
Replace part of ssp:
$actual$.Should().HaveCount($expected$);
But it doesn't find the pattern.
Ideas?
@hmemcpy
Copy link

hmemcpy commented Mar 23, 2015

How are you defining the parameters? I think what R# auto-suggests is incorrect.
Both $expected$ and $actual$ should be Identifier placeholders.

Edit: though having $actual$ as expression works also.
What R# version are you using?

@philippdolder
Copy link
Author

I'm using R# 8.2.3, can't update at the moment.

I have the parameters set as "Argument placeholder". Will try your suggestion, thanks

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