Skip to content

Events are Not Handled in Shim Types #349

@JasonBock

Description

@JasonBock

To Reproduce

Create this test:

var code =
  """
  using Rocks;
  using System;
  
  [assembly: Rock(typeof(IDialogService), BuildType.Create)]
  
  public interface IDialogService
  {
    int ShowSuccess(string message) => message.Length;
    event EventHandler ThresholdReached;
  }
  """;

Expected behavior
The mock is created as expected.

Actual behavior
The following diagnostic is created:

// Rocks\Rocks.RockGenerator\IDialogService_Rock_Create.g.cs(97,6): error CS0535:
'IDialogServiceCreateExpectations.Mock.ShimIDialogService' does not implement interface member 'IDialogService.ThresholdReached'

Additional context
Basically, the event isn't added to the shim type.

This was found on Microsoft.FluentUI.AspNetCore.Components.IDialogService

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions