decline-cookies / anvil-csharp-core

An opinionated collection of systems and utilities that help you build applications in C# quickly, coherently and ready to scale.
MIT License
3 stars 2 forks source link

Unit Tests - Explore more advanced NUnit Functionality #129

Open mbaker3 opened 2 years ago

mbaker3 commented 2 years ago

There are some more advanced attributes that can be assigned to tests. Could we benefit from them in our current tests to increase coverage and testing without as much copy/paste?

Ex: MathUtilTests

tjvezina commented 2 years ago

NUnit Docs

TestCase would do what you want, basically run the same test repeatedly with different inputs and expected outputs.

mbaker3 commented 2 years ago

yea, [Range] looks interesting too. Writing the GetDigitCount() tests the logic was getting sufficiently complex that I thought maybe NUnit should be doing more of the heavy lifting...or maybe I should embrace repetitive code in my tests.

I think I need to read up on best practices.