Understanding the packages.config file

Once you add the project reference to the unit testing project, the IDE adds a few additional assemblies to the testing project. These are used to add support to the testing framework. Let's look into this:

If you expand the References folder of the TestClassLibrary project, you will see two assembly references, Microsoft.VisualStudio.TestPlatform.TestFramework, and Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, along with the reference of our main project. These two DLL references are the core files needed for the unit testing project to function.

In the same project, you will find a file named packages.config, which defines the packages required for the unit testing to create the test adapter with the referenced project. The file content will look like the following XML content, with MSTest.TestAdapter and MSTest.TestFramework defined in it:

<?xml version="1.0" encoding="utf-8"?> 
<packages> 
  <package id="MSTest.TestAdapter" version="1.3.2"  
  targetFramework="net472" /> 
  <package id="MSTest.TestFramework" version="1.3.2"  
  targetFramework="net472" /> 
</packages> 

As we have learned about the packages.config file, let's now move to the next section to begin with the Live Unit Testing steps.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.156.250