Closed shalinparmar closed 5 months ago
We changed some stuff in 1.27
around the renderer and how it is created. Also we dropped support for bunit.web.testcomponents
completely in >1.23
(this was planned since release 1.0.16.
That is why you see that version "mismatch".
So moving forward you would have to migrate those tests. A bit more information can be found in the CHANGELOG.md.
Your given test could be easily rewritten as such:
public void MyFancyTestName()
{
var cut = Render(@<CustomSortableTD Label="Test Label" CustomEventCallback="CustomEventCallbackFunction" IsSortedByCurrentColumn='@false'/>);
cut.MarkupMatches(@<td>
<a href="" role="button" aria-label="Test Label" aria-hidden="false" >Test Label
<i class="fas fa-sort"></i>
</a>
</td>);
}
After upgrading to bUnit 1.27.17, existing test written using bunit.web.testcomponents is failing with the following error:
Method 'CreateTestRenderer' in type 'Bunit.SnapshotTest' from assembly 'Bunit.Web.TestComponents, Version=1.23.9.12610, Culture=neutral, PublicKeyToken=fe9c6306bcc1ce6f' does not have an implementation. Exception doesn't have a stacktrace
Upgrade to bunit latest package and have tests using bunit.web.testcomponents
With this test:
Results in this output:
Should work fine.
Version info: