Jeremy Davis
Jeremy Davis
Sitecore, C# and web development
Page printed from: https://blog.jermdavis.dev/tags/t4-templates

Posts tagged T4 Templates

An experiment with automatic tests

I spent some time working with some code recently, which had some annoying habits of failing oddly in scenarios where nulls got passed into constructors. While I was trying to work around some of these issues, it struck me that tests for parameter handling for constructors are one of those annoying things that tend to make unit testing frustrating. They're annoying boiler-plate to write if you need them, and then a constructor signature changes, you end up with a lot of make-work test changes to do.

So as an exercise in "learning something new", wondered whether I could automate them in a reasonable way...