I'm trying to write Unittests for D365 Plugins and CodeActivities (both being classes). There are small tests that should run in every plugin, such as:

```
[TestMethod]
public void NullLocalPluginContext()
{
    XrmFakedContext context = new XrmFakedContext();

    Assert.ThrowsException<InvalidPluginExecutionException>(
        () => context.ExecutePluginWith<SomePlugin>(null));
}

```

Where `SomePlugin` is the class to be tested (which is for each child different) and cannot be abstract (awaits `IPlugin`). For example here it's a `CheckDuplicateOrder` in the child:

```
[TestClass]
public class CheckDuplicateOrderTest
{
    [TestMethod]
    public void NullLocalPluginContext()
    {
        XrmFakedContext context = new XrmFakedContext();

        Assert.ThrowsException<Exception>(
            () => context.ExecutePluginWith<CheckDuplicateOrder>(null));
    }
}

```

For these small tests I'd like to have this parent with Shared tests but I don't know how to reference the 'to-be' child's target.
I prefer MSTest, but any NuGet framework is accepted.

[Maybe this helps with understanding](https://i.stack.imgur.com/QYriG.png)

Every plugin would have it's own test class.
Every plugintest class needs the basic.
These basic tests should be inherited from parent (so they don't take up space).

Plugins: Dog, Cat, Mouse
PluginTests: DogTest, CatTest, MouseTest
BasePluginTest -> should have shared tests where `SomePlugin` in the exmaple is Dog/Cat/Mouse. But I don't know how to reference it. Every plugin would have a function `TestWalk() { .. ExecutePluginWith<SomePlugin>}`. The Cat should call CatTest, the Dog should call DogTest.