Sponsored Links
-->

Wednesday, June 20, 2018

DATABASE Unit testing made easy with Visual Studio - ppt download
src: slideplayer.com

The Visual Studio Unit Testing Framework describes Microsoft's suite of unit testing tools as integrated into some versions of Visual Studio 2005 and later. The unit testing framework is defined in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll. Unit tests created with the unit testing framework can be executed in Visual Studio or, using MSTest.exe, from a command line.


Video Visual Studio Unit Testing Framework



Elements

Test class

Test classes are declared as such by decorating a class with the TestClass attribute. The attribute is used to identify classes that contain test methods. Best practices state that test classes should contain only unit test code.

Test method

Test methods are declared as such by decorating a unit test method with the TestMethod attribute. The attribute is used to identify methods that contain unit test code. Best practices state that unit test methods should contain only unit test code.

Assertions

An assertion is a piece of code that is run to test a condition or behavior against an expected result. Assertions in Visual Studio unit testing are executed by calling methods in the Assert class.

Initialization and cleanup methods

Initialization and cleanup methods are used to prepare unit tests before running and cleaning up after unit tests have been executed. Initialization methods are declared as such by decorating an initialization method with the TestInitialize attribute, while cleanup methods are declared as such by decorating a cleanup method with the TestCleanup attribute.


Maps Visual Studio Unit Testing Framework



Sample test

Below is a very basic sample unit test:


xUnit.Net : Getting Started Unit Testing With xUnit.net & Visual ...
src: i.ytimg.com


See also

  • Software testing
  • Unit testing
  • Test-driven development
  • Mock object
  • List of Unit Testing Frameworks

DATABASE Unit testing made easy with Visual Studio - ppt download
src: slideplayer.com


References


Course Preview: C++ Unit Testing Fundamentals Using Catch - YouTube
src: i.ytimg.com


External links

  • A Unit Testing Walkthrough with Visual Studio Team Test
  • Microsoft's Unit Testing Framework page
  • MSTest command-line test execution utility

Source of article : Wikipedia