machine/machine.specifications — Issue #83: It statements from base abstract classes are ignored
Author: thedrow
Created: 2011-11-29 15:44:48+00:00
State: open

I have the following base class:

```
public abstract class BaseSpecification
{
// ...
It should = () => do_something();
}
```

If the class is not marked as abstract you get the following stack trace:

> System.ArgumentException: Cannot create an instance of Danel.Nursing.Scheduling.Actions.Adapters.UnitTests.Utilities.BaseSpecification`1[T] because Type.ContainsGenericParameters is true.
> at System.RuntimeType.CreateInstanceCheckThis()
> at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
> at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
> at System.Activator.CreateInstance(Type type, Boolean nonPublic)
> at Machine.Specifications.Explorers.AssemblyExplorer.b__0(Type x) in d:\BuildAgent-01\work\9f23de4d4da9eb12\Source\Machine.Specifications\Explorers\AssemblyExplorer.cs:line 23
> at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
> at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
> at Machine.Specifications.Runner.Impl.DefaultRunner.StartRun(IDictionary`2 contextMap) in d:\BuildAgent-01\work\9f23de4d4da9eb12\Source\Machine.Specifications\Runner\Impl\DefaultRunner.cs:line 101
> at Machine.Specifications.Runner.Impl.AppDomainRunner.AssemblyRunner..ctor(ISpecificationRunListener listener, Assembly assembly, RunOptions options) in d:\BuildAgent-01\work\9f23de4d4da9eb12\Source\Machine.Specifications\Runner\Impl\AppDomainRunner.cs:line 140

However, if the class is marked as abstract the derived specification class does not run the It statements in the base class.
What can be done to remedy this issue?
How can I work around it for the time being until a fix arrives?