1.2.49
Added
List of added functionality in this release.
-
Added more extensions methods to
MarkupMatchesAssertExtensions
to allow asserting withMarkupMatches
onIEnumerable
andIElement
. By @jgoday. -
Added
BunitErrorBoundaryLogger
implementation ofIErrorBoundaryLogger
(needed for Blazor's ErrorBoundary component in .NET 6.0). By @jgoday. -
Added
ComponentFactories
property to theTestContextBase
type. TheComponentFactories
property is aComponentFactoryCollection
type that containsIComponentFactory
types. These are used by bUnits component activator, whenever a component is created during testing. If no component factories is added to the collection, the standard component activator mechanism from Blazor is used. This feature makes it possible to control what components are created normally during a test, and which should be e.g. replaced by a test dummy. More info is available in issue #388.Learn more about this feature on the Controlling component instantiation page.
-
Added
HasComponent<TComponent>()
toIRenderedFragement
. Use it to check if the rendered fragment contains a component of typeTComponent
. Added by @egil. -
Added
AddStub
andAdd
extension methods toComponentFactories
that makes it easy to configure bUnit to replace components in the render tree with stubs. Both methods have overloads that allow for fine grained selection of component types to "double" during testing. Added by @egil in #400.
Changed
List of changes in this release.
-
Updated AngleSharp and related libraries to 0.16.0. NOTE, the new version of AngleSharp includes nullable annotations, which might affect how your code compiles, if you have nullable checking enabled in your test project. By @egil.
-
Updated .NET 6 dependencies to preview 5. By @egil.
Fixed
List of fixes in this release.
-
Fixed JSInterop error message when trying to import an unconfigured module. By @jgoday in #425.
-
Fixed issue where a registered fall-back service provider was not made available to resolve service dependencies of components under test. Thanks to @dady8889 for the reporting the issue.
-
Fixed handling of escaped uri's in FakeNavigationManager. By @linkdotnet in #460.
-
Captured error message from event dispatcher in renderer that would previously be hidden from the user. Related to issue #399.