.NET Core Test Explorer

by Admin 25. December 2017 08:15

Plugin name: .NET Core Test Explorer

Install Steps: 

  1. Go to the extensions market place in VS code and search for ".NET Core Test Explorer"  and install.

Setup steps:

  1. Go to VS Code > File > Preferences > Settings > scroll to “Code Actions on save” as shown in the screenshot below & Click on “Edit in Settings.Json”

  2. Add your test project location from your solution as highlighted in the screenshot. (Eg: "dotnet-test-explorer.testProjectPath": "/tests/ValuesAnalyser.Api.Tests/ValuesAnalyserAPI.Tests.csproj")
  3. Close and open VS code
  4. Ctrl + Shift + P to search for the .NET Core Test Explorer as below

  5. Once selected, VS code will start discovering the tests

  6. Now you can see all the tests and the highlighted "Run Test" & "Debug Test"
  7. Alternately you can right click on the test and either run or debug (make sure you place a break point (smile))
  8. Once the tests pass you should be able to see the green ticks & the ticks on top of the [Fact]


NOTE:  I had the some issues running the tests and here are the steps to resolve

  1. If you got any issues like access to the file / folder denied in the tests. Please run these scripts 

          sudo chown -R vagrant:vagrant /home/vagrant/Desktop/projects/values-analyser-services/

          ls -lah /tmp/NuGetScratch/lock

          rm -rf /tmp/NuGetScratch/

  2. If the tests are not getting discovered, rebuild the Api
    Eg: for ValuesAnalyser Api
    Go to the API location: /home/vagrant/Desktop/projects/values-analyser-services/src/ValuesAnalyser.Api>sudo dotnet build




Plugin name: Prettier formatter for Visual Studio Code

Install Steps: 

  1. Go to the extensions market place in VS code and search for "Prettier - Code formatter"  and install.

Setup steps:

     1. CMD + Shift + P -> Format Document
     1. Select the text you want to Prettify
     2. CMD + Shift + P -> Format Selection

If you are getting the ugly red underlines >  run "dotnet restore" in all your projects


If we want to have single quotes instead of double quotes,

Go to VS Code > File > Preferences > Settings > Go to Prettier code formatter & tick the checkbox as highlighted in the screenshot below

If we want to auto-format on save or on paste,you can modify the settings.json file as below

There are other formatting features available which are available on this page above...


Comments are closed


Tag cloud