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

  • This IDC study assists senior IT leaders in assessing the current state of their hybrid cloud management processes, governance models, technologies, and skills to identify gaps and create a road map for better aligning the organization's management model and tools with the emerging needs of complex, dynamic self-service hybrid cloud environments. This IDC MaturityScape identifies five maturity stages for hybrid cloud management based on a set of specific people, process, and technology dimensions and outcomes. …

  • For many organizations, moving enterprise applications to the public cloud can be a very attractive proposition, but planning the best way to move your applications is mission–critical. As an alternative to the costly option of re–architecting the application for a cloud environment, you can follow a "lift and shift" model that's significantly cheaper and almost always a lot quicker. In order to have a successful "lift and shift" migration, read this white paper to learn a few rules you should …

Most Popular Programming Stories

More for Developers

RSS Feeds

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