Skip to content
This repository was archived by the owner on Dec 26, 2025. It is now read-only.
This repository was archived by the owner on Dec 26, 2025. It is now read-only.

Mock Blazored Modal Instance #598

@Nitesh-bit1991

Description

@Nitesh-bit1991

I am doing unit test using bunit for my Blazored modal. The problem is I cannot mock BlazoredModalInstance as it is contrate class without virtual method. Is there a way to do something like this:

var mockModaInstance = new Mock<BlazoredModalInstance>();
mockModaInstance.Setup(m => m.CloseAsync(It.IsAny<ModalResult>())).Returns(Task.CompletedTask);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions