Improve test coverage
Now that code coverage is run for all builds we have a baseline. It's not awful, but it sure can be improved. At the time of this writing:
- UnitsNet - 56%
- UnitsNet.Serialization.JsonNet - 78%
We do have tons of tests, but many of them only test specific quantities instead of all 95+ quantities.
- Rewrite tests that target specific quantities to test ALL quantities instead, using code generator to output the test code.
- Add tests for classes with very low coverage
- Decide on a reasonable limit to strive for. I propose aiming for >90% coverage since this is a small library with highly testable code.
As an example, here is how Quantity.TryFrom() is only tested for certain quantity types.
https://codecov.io/gh/angularsen/UnitsNet/src/9c12fb1382e8b4b220fe7a9bc625883ce29fc145/UnitsNet/GeneratedCode/Quantity.g.cs
The graphs also clearly show how it is quantity types that make up the majority of missing coverage, which makes absolute sense as per point 1.
Code coverage support was merged in https://github.com/angularsen/UnitsNet/pull/657