I have a set of test steps represented by classes. Each have their own data and methods, so standard stuff. All read in from an XML configuration.
However results from one test may be used as parameters in the next test and I am having some trouble trying to work ou the best way to implement this.
I thought about having a class that is, in essence a dictionary of objects and so each stored value would be able to be associated with a unique key and anywhere that key is used later then test would be able to take it from the dictionary and use it (obviously error/type checking etc would need to be quite good). I don’t really like this but am not sure if there are other patterns of c# functionality that can handle this issue?
So something a bit like this:
<TestRunner xsi:type="TestType1" OutputValue="ResultIndx1"/>
<TestRunner xsi:type="TestType2" InputValue="ResultIndx1"/>
I don’t believe in C# it is possible to have a object within the base class of a hierarchy that is then shared through all base classes is it?
So it’s making me think more towards a Singleton but I want to avoid it if possible.
Any thoughts on how to handle this?
Thanks
A static member in the base class that is not private should suffice.