Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft C# .NET
unit testing in a controlled loop
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Randy A. Ynchausti, post: 7805453"] David, I wouldn't think of it that way. What I would do is to have a base test-class with an instance variable (testObject) of the type of the interface that you have implemented. That base class has all of the test methods that test the proper implementation of the interface. In the "SetUp" method, instantiate the right implementation class and cast it to the interface and store the reference in the testObject variable. In the "TearDown" method, clean the testObject up. All of the test methods should test against the object stored in the testObject instance variable. Then I would subclass that base for each database implementation and inherit all of the testing from the base test-class. Then override "SetUp" and "TearDown" and any other test methods appropriately. This will effectively test all of the different database implementations that you want to support without having a ton of duplicated test code; and without a looping structure. The architecture that I have described above does this. Regards, Randy [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft C# .NET
unit testing in a controlled loop
Top