views:

43

answers:

2

I have a project full of tests, unit and integration alike. Integration tests require that a pretty large database be present, so it's difficult to make it a part of the build process simply because of the time that it takes to re-initialize the database.

Is there a way to somehow separate unit tests from integration tests and have the build server just run the unit tests?

I see that there is an Ordered Unit test in VS2008, which allows you to pick and choose tests, but I can't make it just execute alone, without all the others. Is there a trick that I am missing?

Or perhaps I could adorn the unit tests with an attribute? What are some of the approaches people are using?

P.S. I know I could use mocking for integration tests (just to make them go faster) but then it wouldn't be a true integration test.

+1  A: 

What I usually do is have separate projects and then you can run tests against each assembly independently.

jamesaharvey
I do this also.
Rice Flour Cookies
Seems like an overkill. You should be able to declaratively state which tests are unit tests and which are not.
AngryHacker
+1  A: 

You can create customized lists of tests. Double-click on the .vsmdi file in "Solution Items" to get to the lists of tests for your solution.

Rice Flour Cookies