I agree with the rules, with one exception: "1. It talks to the database" is redundant. Using a database is only not a unit test when it also violates one of the other rules.
I unit test Hibernate mapping files using HSQLDB, an embedded, in-memory database. The database doesn't live on another server, it never touches the file system, it requires not configuration, and it gives complete seperation (one db per JVM). It takes a little time to initialize the test, but it is all due to Hibernate setting up.
As far as I am concerned, these tests are unit tests. If the database that they touched wasn't in-memory, they probably wouldn't be.
Other than this point, I am very much in agreement with the post.
Flat View: This topic has 50 replies
on 51 pages
[
«
|
111213141516171819
|
»
]