Open Daeer-Projects opened 1 year ago
I have done this work - well started it and done a few test classes. It looks like it is working well.
The To()
extension tests are not going well.
I have made some headway with the To()
base test methods. These are for same value tests and simple checks.
The next stage is to add a way to have a collection of inputs and the respective "expected" converted values.
My thoughts at the moment are having abstract methods in the base class for an input (using a generic type) and a DTO that contains all of the expected values when converted. The method could have a collection of these input/output items that might be used in a Theory
test.
Is your feature request related to a problem? Please describe. The tests for the
From()
andTo()
classes are very long and will only get bigger. When I add a new temp scale, adding more tests is very hard and time consuming.Describe the solution you'd like I would like some base classes that have a set of properties and tests already available. So, all I have to do is add a class that inherits from the base tests and add any additional tests I think are relevant to the temp scale I am adding.
Describe alternatives you've considered I've already been adding tests as I went when I added the previous temp scales. They take a lot of time.
Additional context The base class for the
From()
extensions would start like this:It would contain a few properties that could be expanded on for the
To()
tests.The classes that would inherit from the base class would have to override the
ConvertFrom()
method.Base Class:
protected abstract TOutputType ConvertFrom(TInputType value);
Overridden version: