So once I've done some experimenting and I know how I think the shape of my class/service/api will look, I define the interface, then I enter a test driven inner loop which consists of:
Write test for a method (Red)
Code the method until pass (Green)
Refactor until happy (Refactor)
Commit.
The same loop applies when I'm fixing bugs, Step 1 is to write an automated test that replicates the bug, then continues on as normal. Now with the setup described above, all of the building and testing happens automatically while I'm typing. so I'm writing code and red and green are just blinking, until I get to a point where I've got nothing but green.
I haven't managed to get this setup working slick testing parts of the app like controllers, but I'm still new at testing against views, so I imagine as I get more comfortable with it, I can get into a nice system.
I mock services to test business logic at the unit level, and use an in memory database to integration test my services both with and without business logic.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm a huge fan of Test Driven Development, I've been working with Scott Hanselman's setup
So once I've done some experimenting and I know how I think the shape of my class/service/api will look, I define the interface, then I enter a test driven inner loop which consists of:
The same loop applies when I'm fixing bugs, Step 1 is to write an automated test that replicates the bug, then continues on as normal. Now with the setup described above, all of the building and testing happens automatically while I'm typing. so I'm writing code and red and green are just blinking, until I get to a point where I've got nothing but green.
I haven't managed to get this setup working slick testing parts of the app like controllers, but I'm still new at testing against views, so I imagine as I get more comfortable with it, I can get into a nice system.
I mock services to test business logic at the unit level, and use an in memory database to integration test my services both with and without business logic.