You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you search for a component that inherits from another component after you did a search of components of the base class the following exception is thrown:
Message:
System.InvalidCastException : Unable to cast object of type 'Bunit.Rendering.RenderedComponent`1[BUnitRepro.Client.Tests.Components.WorkingComponent]' to type 'Bunit.IRenderedComponentBase`1[BUnitRepro.Client.Tests.Components.SubComponent]'.
Stack Trace:
TestRenderer.GetOrCreateRenderedComponent[TComponent](RenderTreeFrameDictionary framesCollection, Int32 componentId, TComponent component)
TestRenderer.<FindComponents>g__FindComponentsInRenderTree|43_0[TComponent](Int32 componentId, <>c__DisplayClass43_0`1&)
TestRenderer.FindComponents[TComponent](IRenderedFragmentBase parentComponent, Int32 resultLimit)
TestRenderer.FindComponents[TComponent](IRenderedFragmentBase parentComponent)
RenderedFragmentExtensions.FindComponents[TComponent](IRenderedFragment renderedFragment)
TestPageTests.FindBothInReverseInheritanceOrder() line 46
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Describe the bug
When you search for a component that inherits from another component after you did a search of components of the base class the following exception is thrown:
Example:
Example can be found in the following git repo in the BUnitRepro.Client.Tests project
https://github.com/BlueDragon709/BUnitRepro/blob/master/BUnitRepro.Client.Tests/TestPageTests.cs
Expected behavior:
To be able to find a component by type in any order of calling
FindComponent<T>
orFindComponents<T>
without crashing.Version info:
Additional context:
None
The text was updated successfully, but these errors were encountered: