I'm interested in reusing a test theory on a number of classes, specifically a number of constructors that need to the same tests. I initially had the idea of using a delegate to carry out this functionality.
However, I think I'm probably trying to reinvent the wheel and although C# has some functional capability I think I'm attempting an improper method. Is there a supported method for this kind of thing using something more correct than InlineData.
InlineData seems to be for inject the input so I might test many examples of a given test. But can I supply several variables to several methods and get testing ^x not *x
[Theory]
[InlineData(input => new ConcreteConstructor(input)) ]
public void Constructor_Should_Not_Throw_Expection (Action<string>)
{
constructor("SomeString");
}
N.B I think I should be using Func in this case as an object is returned. Anyhow I suspect it's completely the wrong approach so it's not the main consideration.