Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Slightly Different Use for nUnit Testing

Status
Not open for further replies.

Guru7777

Programmer
Dec 10, 2003
331
US
I work in an environment that is going to start using nUnit and nUnitAsp for some TDD. The actual tests themselves aren't proving to be much of a problem, but we are running into another issue that is causing division.

Our lead developer wants to build a unit test that would be run against a new server. It would check for the existence of DSNs and Application directories, etc. If those things didn't exist, it would fail the test.

I am now tasked with finding out some information about this, but I don't even know how to search for this. Everything I have tried makes it look like no one else is trying to do this.

Is this a mistake? Is there a better way to do these kinds of checks? I know that this isn't the use of Unit Testing, per se, but it could work - and does in limited testing.

Can you offer any suggestions or comments on this, please? Thank you.

----------------------------------------

TWljcm8kb2Z0J3MgIzEgRmFuIQ==
 
Do the tests depend on those configuration options existing?

Because if they don't, they don't belong in a unit test.

If they do, then you should put them in your [ignore][TestFixtureSetup][/ignore] method.

Chip H.

____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
The tests don't depend on those configurations, but the applications do. The tests are run on the code before it would hit this box.

What the lead developer wants to do is basically make a "New Server Unit Test" where he ensures that our new boxes are ready to be used. (I do realize that making an image and ghosting new boxes would be the best solution, but we do not have control over that.)

Is there a better way to automate a "box readiness test"?

----------------------------------------

TWljcm8kb2Z0J3MgIzEgRmFuIQ==
 
Yeah, I would think that NUnit is not the tool for this.

If you need to know if a bare-bones Windows machine is capable of running your app (does it have the needed runtimes and pre-requisites?), then you obviously can't use any of those runtime libraries in the creation of a program to check for their existence.

Which means that your machine compatability tester needs to be written in plain old Win32 and C/C++, because that's the only thing you're assured of running on all Windows machines.

Chip H.

(Special note: the VB6 runtime is present on some versions of Win2k and later OS's, but it's unpatched, so I wouldn't trust it myself)


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
It can be assumed before running the test that the machine would have the .Net Framework installed.

But, I agree with the rest of what you said, and it was generally how I felt about it.

These are ASP.Net applications, so the .Net Applications that are created in IIS would change fairly often before a new server would need tested. The same can be said for an DSNs or whatever else each application might need.

Is it even worth the effort of writing a test app, with so much maintenance needed for such a little result?

----------------------------------------

TWljcm8kb2Z0J3MgIzEgRmFuIQ==
 
It depends on how many copies of your app will be installed. For an internal application, probably not worth it. For something that will sell more than 50 copies, it starts to become worthwhile just to keep the support costs down.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top