Monday, October 13, 2008

Unit Testing III

When testing a method with a WCF call the Test Project must have the same WCF referenced within it.

Likely to get an Exception
Could not find endpoint element with name '...' and contract '...' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.

Tuesday, October 7, 2008

Unit Testing II

Its been a while since I wrote any Unit Tests in anger (even then it was part of a University project)...


So I'm listing a few essential pieces of knowledge that seem to have escaped me...

1. This is not an exciting job - the important ones rarely are!

2. Include any Connection Strings or similar in the Test Project's app.config file.

3. Do this carefully - especially when your WCF interacts with multiple databases.


4. Objects & Lists? It can be difficult to compare two of these instances, like all tests (and these are the easy ones) be creative!

5. A Test project does not always react well to having multiple subject projects to test.

6. A Solution will not always react will to having multiple Test Projects in it.

Unit Testing I

I am currently writing some Unit Tests to allow automated building and load testing for a .NET WCF.

One of the methods in the WCF remained a skeleton, throwing a NotImplementedException, which I sepent a while googling before I checked the code, learn by stupid mistakes, check the code first!

home | www.purplepool.com