I am getting null reference exception in TestRenderer when rendering a component. Maybe someon will help me out from this. #1449
Unanswered
GunnarPiho
asked this question in
Q&A
Replies: 1 comment
-
Hey @GunnarPiho can you show the code of your component under test? The stack trace indicates it comes from the component on its first render cycle. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is the message I am getting
Message:
Test method Abc.Tests.Razor.Shared.SmartEhrDetailTests.GetItemTypeTest threw exception:
System.NullReferenceException: Object reference not set to an instance of an object.
Stack Trace:
RadzenSplitButtonItem.get_ItemClassList()
RadzenSplitButtonItem.BuildRenderTree(RenderTreeBuilder __builder)
ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
--- End of stack trace from previous location ---
TestRenderer.AssertNoUnhandledExceptions() line 629
TestRenderer.Render[TResult](RenderFragment renderFragment, Func
2 activator) line 480 TestRenderer.RenderFragment(RenderFragment renderFragment) line 101 TestContextBaseRenderExtensions.RenderInsideRenderTree(TestContextBase testContext, RenderFragment renderFragment) line 43 TestContextBaseRenderExtensions.RenderInsideRenderTree[TComponent](TestContextBase testContext, RenderFragment renderFragment) line 23 TestContext.Render[TComponent](RenderFragment renderFragment) line 68 TestContext.RenderComponent[TComponent](Action
1 parameterBuilder) line 54SmartEhrDetailTests.GetItemTypeTest() line 148
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
The line 148 is ...RenderComponent
Beta Was this translation helpful? Give feedback.
All reactions