If you find yourself supporting a WinForms application, you're likely to notice the tests... or lack thereof. Just because we may not have been so focused on automated tests and continuous integration when WinForms was younger, that doesn't mean we can't introduce them now. Better late than never!
When you're writing tests, you generally don't want to write to the database, email customers, and hit third-party API's. That's why we need to know how to mock dependencies!
Porting .NET Framework code to .NET Standard has been a learning experience, with some challenges too. This time I had a .NET Standard library that expected an application config file, but loading one from an NUnit test suite proved to be more difficult than it sounded at first.
I ran into an issue where an EUnit test fixture was failing with an error I hadn't seen before. It seemed to be coming from the meck mocking suite itself, and was reporting that it was 'already_started' and the tests would fail to run... that's a new one. So the obvious question was, WTF@#$ WHY????
While working a code kata last month, I paired with someone to do it in C#. It was a good opportunity for trying out Visual Studio for Mac. Although I've previously kicked the tires on VS4Mac a bit, one of the things I hadn't tried testing out was, well.. testing. As it turns out, it's pretty easy!
When you create a program, you should be thinking about how you’ll know it’s right when it’s done. How will you make sure it’s doing what it’s supposed to do, before it goes to production? TDD and red-green-refactoring can help!