5
votes

Looking for some advice on how to proceed here.

I am trying to do some integration testing on wcf services that call other wcf services. I want to make sure that they are configured correctly between one another. We are currently using spring.net and Nhibernate. What I am not sure about is how to check that the database is getting updated without actually saving anything to the database.

I have both msmq and wshttp services that I am trying to test here. I am familiar with transactions, as we use them in spring, but I have no idea how to setup my tests to rollback the transaction in a service that is not being tested directly by the integration test.

Right now the only option I have come up with is using a test database and test data, but it seems like there has to be a better solution than this.

2
Why would you prefer to test your software on a production database, instead of a test database?CodeCaster
Maybe you misread me? The only option I have came up with so far is to create a test database and test data.Aaron M
Could you set up all your services to use the same database and share the same SessionFactory?Marijn

2 Answers

0
votes

Perhaps you can mock the services that update the database (or the DAL layer) using something like Moq, avoid the call to the database and checking with the verify method of the mock that the call to the database will be performed. In our project we are using this library with wcf with very good results.

0
votes

I decided to go with an implementation that is application specific. Basically creating a test database, and having our application hit the test database based on some values that are passed into our service.