Looping Tests over a Template Database?

AzhkanizkaelAzhkanizkael Posts: 3 New member
Hey Guys! I'm working on writing some tests and was wondering why this hasn't ever been discussed as far as my searching has reached.

My goal is to have a single test that loops across every view in the template database and grabs the create scripts for all views and creates fakeviews of them. Then 1 by 1 does an AssertEqualsTable against the actual (from the testing database) and the expected (from the template database). If they differ, it will return what they differ on and loop through every view until completed.

Reasoning for this would be that I don't have to hard code the expected results, and can simply say that if you run the queries from both the testing database and the template database and they return the same results, it passes, but if different results are returned, then it doesn't pass and it'll output the reasoning for the failure.

This would allow you to automatically fail anything that might not get a test written for it because it doesn't exist in the template database.

Why would this be a bad idea?
Why don't more people do this?

I can provide code example upon request.
Sign In or Register to comment.