Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My unit test project icon is displaying like a class library... how to fix?

I have 2 c# test projects in my VS2012 Update 1 solution, one shows a class library icon, one shows a test project icon. They both work as test project, but the discrepancy is driving me crazy. (short drive). Anybody know how to fix this? I've looked at the .csproj and the .sln files, but nothing is leaping out at me.

like image 992
Jeremy Holovacs Avatar asked Mar 05 '13 02:03

Jeremy Holovacs


People also ask

How do I enable unit testing?

Turn live unit testing from the Test menu by choosing Test > Live Unit Testing > Start.

How do I run a unit test project in Visual Studio?

Run tests in Test Explorer If Test Explorer is not visible, choose Test on the Visual Studio menu, choose Windows, and then choose Test Explorer (or press Ctrl + E, T). As you run, write, and rerun your tests, the Test Explorer displays the results in a default grouping of Project, Namespace, and Class.

How do I debug a test in Visual Studio Mac?

Instead of starting the ShowCase app project, ctrl -click the StringLibraryTests project, and select Start Debugging Project from the context menu. Visual Studio starts the test project with the debugger attached. Execution will stop at any breakpoint you've added to the test project or the underlying library code.


1 Answers

  • Right-click the project in Solution Explorer and choose Edit Project File
  • Add a new child in the <PropertyGroup> node:

    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

  • Save your changes and close the file

  • Right-click the project in Solution Explorer and choose Reload Project

https://adamprescott.net/2012/03/29/convert-a-class-library-to-a-test-project-in-visual-studio/

like image 52
Pawel Gorczynski Avatar answered Sep 20 '22 17:09

Pawel Gorczynski