AssertMessage
Add 'message' parameter to Assertions. Nunit, Mstest, Xunit is supported.
Install / Use
/learn @Fody/AssertMessageREADME
<img src="/package_icon.png" height="30px"> AssertMessage.Fody
Adds 'message' parameter to Assertions. It is generated from source code.
See Milestones for release notes.
This is an add-in for Fody
It is expected that all developers using Fody become a Patron on OpenCollective. See Licensing/Patron FAQ for more information.
Usage
See also Fody usage.
Supported frameworks:
- Nunit
- Mstest
- Xunit
NuGet installation
Install the AssertMessage.Fody NuGet package and update the Fody NuGet package:
PM> Install-Package Fody
PM> Install-Package AssertMessage.Fody
The Install-Package Fody is required since NuGet always defaults to the oldest, and most buggy, version of any dependency.
Add to FodyWeavers.xml
Add <AssertMessage/> to FodyWeavers.xml
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
<AssertMessage/>
</Weavers>
Your Code
public void CustomerTest()
{
var expectedCustomer = new Customer();
var actualCustomer = new Customer();
...
Assert.AreEqual(expectedCustomer.Money, actualCustomer.Money);
}
What gets compiled
public void CustomerTest()
{
var expectedCustomer = new Customer();
var actualCustomer = new Customer();
...
Assert.AreEqual(expectedCustomer.Money, actualCustomer.Money, "Assert.AreEqual(expectedCustomer.Money, actualCustomer.Money);");
}
Pdb files
The Pbd files are required for this plugin. To make it work in Release, enable Debug Info(pdbonly) in Advanced Build Settings Dialog Box. More info
Icon
Message by [Prerak Patel(https://thenounproject.com/prerakpatel/) from The Noun Project
Related Skills
openhue
341.0kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
341.0kElevenLabs text-to-speech with mac-style say UX.
weather
341.0kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.5kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
