Posts Tagged ‘Unit testing’

Developing and Testing Data Access of SQLCEPad tool using Self-Shunt and Stub tetsing patterns

Sometimes ago I developed a simple tool for creating and executing SQL statements against SQL CE 3.5 database. Yesterday, I’ve decided to re-develop and improve it in a new version. I’ve started with implementation of data access part of it. The data access is very simple; it retrieves all needed DB schema meta-data that the [...]

Execute unit tests against DB and keep it unchanged using AOP

Few weeks ago, I wrote about how to extend Nunit to support RollBack attribute and how to execute unit tests against database and keep it unchanged.
Today, I’ve tried to achieve the same functionality but using AOP. Actually, I’ll use PostSharp platform in order to weave needed code in each test method decoreted with RollBackAttribute. PostSharp [...]

The power of unit tests

What i’d like to share with you is that the unit tests are really power and they make developers life much easier. I saw a lot of developers that said that unit testing is just a spent time in not right direction (developing code). As I remember in the beginning I also was in this [...]

Execute unit tests against DB and keep it unchanged.

In my old post I explained how you can create a NUnit add-in for reverting changes in database made by unit tests. In this add-in I use TransactionScope class to open a MSDTC transaction and rollback changes made by the unit test. I found this approach time consuming and unpredictable (sometimes my tests doesn’t work [...]

How to extend NUnit to support transaction rollback?

The code for this article you can download here.
I create some unit tests which should test functionality connected with databases. I know that there are a lot of posts about not to test against database but from my experience I think it is better than using Mocks instead of. What I want is to have [...]