Re: establishing logical test order?

"Butler, Tony (London)" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
On Tue, Jun 24, 2008 at 12:30 AM, Butler, Tony (London)
>> In theory, yes, that is what one "should" do, but in practice, you
have
>> to be a bit pragmatic at times.
>
>Really? I love DI, but I would turn and run from a testing environment
>which thought we "should" use DI for everything outside the
>object-in-test. That would be a maintenance nightmare. I would be
>running from fear of being crushed under a mountain of heavy source
>code, and bits don't even weigh very much!  Fortunately, I wouldn't
>have to run very fast, because that code would be moving at a glaciers
>pace. Just think of how many String, List, Hash, and Sort mocks you
>would have!

I don't think any sane person would be mocking out fundamental framework
things like strings and lists.

You might however wrap the .NET mail services or database access classes
and mock those for testing.
For example, I recently had to test that some distribution list
functionality correctly split a table of data and send the right bits to
the right recipients (Also specified in the data).
I wrapped access to the mail server, injected a mock mailserver into my
unit tests, and could examine the actual mail messages being sent to the
mail server to ensure correct contents and recipients.
Since this was a mock mail server, the real recipients were not flooded
with test emails, yet I could be fully confident that in production, my
code would work.

Since you are already DI-aware and are not using it for the project
which prompted you to post here about ordering dependent tests then
presumably you deem DI not appropriate for this case, so we may as well
end the discussion here since it's turning into a DI-101 topic instead
of an nunit one.

Cheers

Tony
--------------------------------------------------------

This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secur
 e or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing.
--------------------------------------------------------

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.