2
votes
5answers
332 views

Understanding unit tests/TDD for ASP.NET webforms [closed]

I'm the lead programmer at a small software firm (currently 4 developers including myself), we develop bespoke ASP.NET WebForms applications for businesses. I joined there in 2010 just after ...
12
votes
3answers
467 views

Brittle unit tests due to need for excessive mocking

I've been struggling with an increasingly annoying problem regarding our unit tests that we are implementing in my team. We are attempting to add unit tests into legacy code that wasn't well designed ...
5
votes
2answers
475 views

Event Driven Programming: A sequence of unfortunate events

I have a very basic game loop whose primary purpose is to check for updates & changes to a list. I have contemplated using event driven programming to replace the game loop/list idea with an ...
5
votes
2answers
250 views

Helper static methods in TDD

I am creating an application which will be testable(unit + integration). In this application I have a FileHelper static class, public static class FileHelper { public static void ...
0
votes
2answers
512 views

Should I use a seperate class per test?

Taking the following simple method, how would you suggest I write a unit test for it (I am using MSTest however concepts are similar in other tools). public void MyMethod(MyObject myObj, bool ...
4
votes
2answers
318 views

How and what should I be (unit) testing for in this method?

I am relatively new to unit testing and have a query about what/how I should be testing a certain method. For the following (psudo-c#) method I have created (not a real-life example) what would you ...
13
votes
5answers
2k views

How to structure unit tests for a GUI app using C# and NUnit

I've been asked to do a small side-project to supply a simple application to one of our customers. Normally I would be working on back-end code where I have all of my testing needs figured out, and ...
6
votes
2answers
434 views

How to structure this program?

I am struggling with the best way to structure a program that I am writing because the method I currently have feels very clunky and each part depends a lot on the others. This is what the program ...
8
votes
5answers
2k views

How to simulate events that cause exceptions to test try/catch blocks?

I understand how exceptions work and how to catch and handle them in C# but how can I simulate events that may cause an exception to ensure that it is caught correctly? For example, is it possible to ...