Components, relying on Radzen Service classes are not unit testable #483

Closed
opened 2026-01-29 17:38:04 +00:00 by claunia · 1 comment
Owner

Originally created by @MPapst on GitHub (Jul 26, 2022).

Is your feature request related to a problem? Please describe.
I am using Radzen in a WASM project, trying to implement Unit Tests for my created components.
Therefore I am mocking all Services I inject. Unfortunately the services provided by the Radzen Library are not mockable, because they are not providing interfaces.
The change would be optional and would not break any existing implementations. Nevertheless I think it is binary incompatible (unsure about that).

Describe the solution you'd like
Extract Interfaces for NotificationService, TooltipService, DialogService, ContextMenuService

Describe alternatives you've considered
An alternative solution would be to wrap the services on my own.

Originally created by @MPapst on GitHub (Jul 26, 2022). **Is your feature request related to a problem? Please describe.** I am using Radzen in a WASM project, trying to implement Unit Tests for my created components. Therefore I am mocking all Services I inject. Unfortunately the services provided by the Radzen Library are not mockable, because they are not providing interfaces. The change would be optional and would not break any existing implementations. Nevertheless I think it is binary incompatible (unsure about that). **Describe the solution you'd like** Extract Interfaces for `NotificationService`, `TooltipService`, `DialogService`, `ContextMenuService` **Describe alternatives you've considered** An alternative solution would be to wrap the services on my own.
Author
Owner

@MPapst commented on GitHub (Jul 26, 2022):

The previous implementation I made will break the Notification Component.
Unfortunately its not that easy without breaking existing implementations :/

@MPapst commented on GitHub (Jul 26, 2022): The previous implementation I made will break the Notification Component. Unfortunately its not that easy without breaking existing implementations :/
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#483