Skip to content

Instantly share code, notes, and snippets.

@philippdolder
Created August 28, 2012 07:42
Show Gist options
  • Save philippdolder/3495944 to your computer and use it in GitHub Desktop.
Save philippdolder/3495944 to your computer and use it in GitHub Desktop.
Shortened messages in FluentAssertions
// The verification is as follows:
Execute.Verification
.ForCondition(elementsWithCorrectValue.Any)
.FailWith(string.Concat(Message, " with name {2} and value {3}"), assertions.Subject, elementName, name, elementValue);
// The error message with 1.7.1.1 is:
Expected collection
{<Field Name=\"fieldName\">...</Field>}
to contain a "Field" element with name "fieldName" and value "before\r\nafter"
// Earlier with 1.6.0.0 it was
Expected collection
{<Field Name="fieldName">
<SubElement />
</Field>}
to contain a "Field" element with name "fieldName" and value "before\r\nafter"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment