Understanding the package config

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

If you expand the References folder of the TestConsoleApp 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 that are 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.1.11"  
           targetFramework="net462" /> 
      <package id="MSTest.TestFramework"  
           version="1.1.11"  
           targetFramework="net462" /> 
    </packages> 
..................Content has been hidden....................

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