Possible Duplicate:
Why cannot C# generics derive from one of the generic type parameters like they can in C++ templates?
Generic class that inherits its generic type
I would like to be able to do something like this, only in C#:
template<class MyClass>
class MockComposite : MyClass
{
};
The class above inherits from the specified type. MyClass is a base type, and this is the reason I want this behaviour. I want to be able to instantiate this object with classes derived from MyClass.
I understand you cannot use templates in C#, but is there any way to get the behaviour I want without having to write a new class for each different type of object?
EDIT - I want to be able to instantiate an object that will test the behaviour of any class, as long as that class is derived from a specified type - 'MyClass'.