Unit Testing .NET Applications Using Code Contracts

As a developer is going through the testing phase of application development, they will typically take the app through unit testing, where several small tests validate each unit of code. Each application will typically require hundreds or even thousands of tests to successfully validate the code.

Like the application itself, the success of the unit tests depends on how they are written. Code Contracts, available since the debut of .NET framework 4, go hand in hand with unit testing. They enable the developer to define preconditions, postconditions and class invariants, and require code to be embedded in a developer's existing classes.

As a developer is going through the testing phase of application development, they will typically take the app through unit testing, where several small tests validate each unit of code. Each application will typically require hundreds or even thousands of tests to successfully validate the code.

View Article



Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Modern contact centers support a variety of digital channels—email, chat, co-browsing, social, video—over multiple digital touchpoints (web or mobile devices). What they lack is the ability to link interactions in a step-by-step journey to provide a personal, contextual experience for each customer. Download this eBook. Learn how you can: Design a successful digital customer engagement strategy Provide agents with a 360-degree view of the customer across all digital channels and voice Deliver …

  • On-demand Event Event Date: March 23, 2017 As you adopt the use of cloud services, whether in public/IaaS, SaaS or hybrid environments, the attack surface expands and, if breached, the costs increase exponentially. This session is designed to help IT and security leaders understand and address the unique challenges that enterprises typically face when they deploy their applications in the public cloud. It summarizes the areas that the public cloud vendors typically take care of and highlights the areas …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date