D For A Web Developer
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Sat May 3 12:32:31 PDT 2014
On 4/30/2014 1:36 PM, Andrei Alexandrescu wrote:
> One good example is networking tests - if I worked on an airplane I'd love to
> not test tests that need connectivity with a simple regex.
I am suspicious that testing networks with a unit test is an inappropriate use
of unit tests.
Unit tests should be testing individual functions. The "network" for those tests
should be a mockup, not the actual network. A mock network:
1. can model extreme, unusual, perverse, and corner cases of networks, whereas
real networks try to avoid that
2. will generate reproducible results
Testing networks should be more of a system test, not a unit test.
More information about the Digitalmars-d
mailing list