DEV Community

Kenichiro Nakamura
Kenichiro Nakamura

Posted on

Visual Studio: Live Unit Test is awesome

I am okay writing unit test, but there are several things I don't like.

  • Keep checking the coverage report
  • Test failed after changing so many codes as a regression

Visual Studio Live Unit Testing feature helps me to solve these issues.

As the official document is very easy to read, I won't re-write it here but I just want to take note for several important things.

Prerequisites

  • Enterprise edition of Visual Studio
  • C# or VB.NET
  • Supports xUnit, NUnit and MSTest

What it does?

Basically, the Visual Studio runs existing unit tests background and let me know:

  • Which lines are covered by test
  • The test results
  • Which tests are covering the line

Every time I change the code, it runs automatically and shows me the results.

Live Unit Testing

Detail

Caveat

It uses computer power, so recommend not to use it if you see any heavy performance decrease in your PC. Also be careful about the battery life if you work in cafe without AC.

Summary

I turn it on all the time as my PC is powerful enough to run it without any issues so far. Please try if you meet the prerequisites!

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay