microsoft / testfx

MSTest framework and adapter
MIT License
749 stars 255 forks source link

Capture Multiple Assertion Support #913

Open Grauenwolf opened 3 years ago

Grauenwolf commented 3 years ago

Description

There are times when we want to capture multiple assertions at the same time. For example, checking a set of properties for equality.

Assert.AreEqual(key, echo.EmployeeClassificationKey);
Assert.AreEqual(row.EmployeeClassificationName, echo.EmployeeClassificationName);
Assert.AreEqual(row.IsEmployee, echo.IsEmployee);
Assert.AreEqual(row.IsExempt, echo.IsExempt);

It would be useful if we had the equivalent to NUnit's Assert.Multiple feature.

https://docs.nunit.org/articles/nunit/writing-tests/assertions/multiple-asserts.html

An alternate implementation is assertion scopes from Fluent Assertions.

https://fluentassertions.com/introduction#assertion-scopes

Evangelink commented 1 year ago

Relates to #571