Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Unit testing is all about testing your code in isolation from its dependencies. Why is it important to isolate your code from its dependencies? There may be several reasons:
On the other hand, many other dependencies are perfectly safe in unit testing context. Do you need to isolate your code from System.Xml or System.Design? That wouldn't really make sense. These dependencies are very stable - they are part of the BCL and will not change unless you run your application on a different framework version, and even then, the framework versions are backwards compatible.
Stable dependencies may extend to third-party libraries. If you use a third-party library which you have determined to be robust and readily available, there may not be any reason to isolate your code from it.
The types of dependencies listed above, however, introduce a certain amount of instability to your unit. To distinguish them from stable dependencies, I suggest the term volatile dependencies. These are the types of dependencies from which you need to isolate your unit when writing unit tests.
Anonymous
August 27, 2006
The recent discussion spawned by my former post has prompted me to write this entry about test...
Anonymous
May 29, 2007
Object-oriented applications above some level of complexity are almost always modelled as a layered architecture.
Anonymous
May 30, 2007
In his article on Inversion of Control and Dependency Injection , Martin Fowler has a quite interesting
Anonymous
August 20, 2007
Besides logging, one of the most common types of ambient context is the user. Who is the user? Was the
Anonymous
August 20, 2007
PingBack from http://msdnrss.thecoderblogs.com/2007/08/20/user-context/
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in