Skip to content

Internal Virtual Members Prevent a Mock From Being Created #181

@JasonBock

Description

@JasonBock

To reproduce this:

// Note that this has to be compiled into its' own assembly
public abstract class InternalTargets
{
	public abstract void VisibleWork();
	internal abstract void Work();
}

// This class has to be in a different assembly.
public static class Test
{
	public static void Test() => Rock.Create<InternalTargets>();
}

Rocks can't access the internal abstract Work() member in InternalTargets. So, if a type has any members that could be mocked, but are not accessible, a diagnostic should be created to prevent this.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions