Closed jakob-reesalu closed 1 year ago
For check after map render you should use MapComponent OnAfterInit event Maybe making MapComponent props virtual should do any harm. What you think?
<GoogleMap @ref="@map1" Id="map1" Options="@mapOptions" OnAfterInit="@AfterMapInit"></GoogleMap>
If you're using bUnit
you can use component stubbing alongside something like Moq
or NSubstitute
https://bunit.dev/docs/providing-input/substituting-components.html
Closing due inactivity. Feel free to open.
Hi!
I need to mock the GoogleMap class for testing and it sort of works, up to one little detail, namely having the GoogleMap.InteropObject return a value, or just not be null. Because, in my code I must do the below null check on the InteropObject, in OnAfterRenderAsync:
However, InteropObject is a
private set
so I can't assign it a value for a test. And Moq nor FakeItEasy can mock/fake this because InteropObject doesn't have the virtual keyword, so I can't override it for testing purposes. Or, so I understand it at least.Any help on this?