{"id":2930,"date":"2017-03-10T08:01:11","date_gmt":"2017-03-10T16:01:11","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2930"},"modified":"2025-06-13T19:29:17","modified_gmt":"2025-06-14T02:29:17","slug":"visual-studio-live-unit-testing-2017","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/","title":{"rendered":"Visual Studio Live Unit Testing: New to Visual Studio 2017"},"content":{"rendered":"<div id=\"preamble\">\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p><a href=\"https:\/\/www.visualstudio.com\/en-us\/news\/releasenotes\/vs2017-relnotes\">Visual Studio 2017<\/a> was just officially released. It comes with a lot of new, great stuff, but one of my favorite new features is built-in Visual Studio Live Unit Testing (available in Visual Studio 2017 Enterprise, not yet available for .NET Core projects).<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>In this post, I\u2019m going to show you how Visual Studio Live Unit Testing works, as well as some thoughts around using unit tests vs <a href=\"https:\/\/www.couchbase.com\/blog\/integration-tests-couchbase-application\/\">integration tests<\/a>. You can follow along by getting the full source code for this <a href=\"https:\/\/github.com\/couchbaselabs\/blog-source-code\/tree\/master\/Groves\/057VisualStudioContinuousTesting\/src\/LiveUnitTesting\">Live Unit Testing example on GitHub<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_visual_studio_live_unit_testing_with_nunit\">Visual Studio Live Unit Testing with NUnit<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>NUnit is perhaps the most popular testing tool for C#\/.NET developers. Visual Studio Live Unit Testing can also work with xUnit and MSTest, but for this post I\u2019m going to just cover NUnit.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>To use NUnit, you add it with NuGet, just as normal. To use Visual Studio Live Testing, you\u2019ll also need to add the <a href=\"https:\/\/www.nuget.org\/packages\/NUnit3TestAdapter\">NUnit Test Adapter<\/a> (<code>Install-Package NUnite3TestAdapter<\/code>).<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Next, start Live Testing by clicking Test \u2192 Live Unit Testing \u2192 Start.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/057_01_EnableLiveUnitTesting.gif\" alt=\"Start Visual Studio Live Unit Testing\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_writing_a_unit_test\">Writing a Unit Test<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>We\u2019ll need some unit tests to demonstrate. We could just do <code>Assert.That(1, Is.EqualTo(1))<\/code>, but where\u2019s the fun in that? Let\u2019s create a shopping cart class.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">public class ShoppingCart\r\n{\r\n    public string UserName { get; set; }\r\n    public DateTime LastUpdated { get; set; }\r\n    public List&lt;Item&gt; Items { get; set; }\r\n    public decimal Total\r\n    {\r\n        get { return Items.Sum(i =&gt; i.Price); }\r\n    }\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>This shopping cart has a couple properties, and a collection of items in it. Notice the <code>Total<\/code> property. Astute readers may already notice some problems with it, but let\u2019s start with a single, simple unit test to make sure it calculates a total.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">[Test]\r\npublic void ShoppingCart_Total_Should_Sum_Up_the_Item_Prices()\r\n{\r\n    \/\/ arrange: create shopping cart with 2 items and figure out the expected total\r\n    var item1 = new Item { Name = \"Large Pepperoni Pizza\", Price = 14.99M };\r\n    var item2 = new Item { Name = \"Cheese Sticks\", Price = 4.99M };\r\n    var expectedTotal = item1.Price + item2.Price;\r\n    var cart = new ShoppingCart { Items = new List&lt;Item&gt; { item1, item2 } };\r\n\r\n    \/\/ act: user the Total method on ShoppingCart\r\n    var actualTotal = cart.Total;\r\n\r\n    \/\/ assert: totals should match\r\n    Assert.That(actualTotal, Is.EqualTo(expectedTotal));\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>If Live Unit Testing is turned on, then the test is being automatically run in the background by Visual Studio. You should see some green checkmarks appear.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/057_02_LiveUnitTest.gif\" alt=\"Visual Studio Live Unit Testing in action\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>The green checkmarks will also appear wherever the code that is under test is covered.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/057_03_CodeUnderTest.png\" alt=\"Visual Studio Live Unit Testing code under test\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>With Visual Studio Live Unit Testing, you don\u2019t have to stop to run the tests. As you are coding, the tests will run, and give you immediate feedback on whether your code is making tests fail (or whether you\u2019ve written enough code to make your test pass).<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Most of all, this will encourage you to write more tests.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_what_are_integration_tests\">What are Integration Tests?<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>When writing unit tests, you are meant to test a small piece of code on its own. For code that interacts with some external service (a web service, a database, a file system, etc), you often mock those pieces out, so that you can focus on the unit.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>You may also write integration tests with NUnit. Integration tests that are meant to go beyond testing a single unit of code, and test that systems work together. Let\u2019s write a method that writes a record to Couchbase Server. This test will use a real database, therefore we can consider it an integration test.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">public void SaveShoppingCart(ShoppingCart cart)\r\n{\r\n    _bucket.Insert(new Document&lt;ShoppingCart&gt;\r\n    {\r\n        Id = Guid.NewGuid().ToString(),\r\n        Content = cart\r\n    });\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>This method should save a shopping cart to a document in Couchbase Server. To make sure it\u2019s working, we can write an NUnit test.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">[Test]\r\npublic void Repo_Can_Save_a_New_Shopping_Cart_to_Database()\r\n{\r\n    \/\/ arrange: create a shopping cart\r\n    var cart = new ShoppingCart\r\n    {\r\n        UserName = \"Matthew \" + Guid.NewGuid().ToString(),\r\n        LastUpdated = DateTime.Now\r\n    };\r\n\r\n    \/\/ act: save shopping cart to database\r\n    Repo.SaveShoppingCart(cart);\r\n\r\n    \/\/ assert: check that the cart was saved\r\n    var cartBackOut = Repo.GetCartByUserName(cart.UserName);\r\n    Assert.That(cartBackOut, Is.Not.Null);\r\n    Assert.That(cartBackOut.UserName, Is.EqualTo(cart.UserName));\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p><em>Note: To keep this post simple, I omitted some of the repository details, and test setup. You can view all of this in <a href=\"https:\/\/github.com\/couchbaselabs\/blog-source-code\/tree\/master\/Groves\/057VisualStudioContinuousTesting\/src\/LiveUnitTesting\">the GitHub repository<\/a>.<\/em><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_integration_test_with_visual_studio_live_unit_testing\">Integration Tests with Visual Studio Live Unit Testing<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Visual Studio Live Unit Testing will happily run this unit test. You may not want these types of tests to be running in the background automatically because:<\/p>\n<\/div>\n<div class=\"olist arabic\">\n<ol class=\"arabic\">\n<li>If you don\u2019t have Couchbase Server installed, or a bucket created and indexed, then they will fail.<\/li>\n<li>If you have a lot of tests that rely on external components, they could slow down the tests (reading\/writing documents in Couchbase is very fast, but setting up a <code>Cluster<\/code> object for each test or test fixture is not).<\/li>\n<li>These tests could add a lot of unnecessary junk test data to your database.<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_excluding_integration_tests_from_visual_studio_live_unit_testing\">Excluding Integration Tests from Visual Studio Live Unit Testing<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>To exclude tests from Live Unit Testing, you can simply right-click on the test file and select &#8220;Exclude&#8221; from the context menu.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/03\/057_04_ExcludeFromLiveUnitTest.gif\" alt=\"Exclude from Live Unit Testing\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>After this, none of the tests in that file will be executed by Live Unit Testing. You can also exclude an entire project. So, if you organize unit tests and integration tests into separate projects, then you are all set.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>If you <em>don\u2019t<\/em> organize them into separate projects, then this process could be a bit tedious. Further, the Include\/Exclude information is a local setting that can\u2019t (as of the time I\u2019m writing this, and to the best of my knowledge) be committed to source control.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>So, after asking about <a href=\"https:\/\/stackoverflow.com\/questions\/42657226\/visual-studio-2017-live-testing-exclusions\">Live Testing exclusion on StackOverflow<\/a>, I created an attribute that you can place on tests to exclude them from Live Testing.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-c#\">public class IgnoreForLiveTesting : Attribute, ITestAction\r\n{\r\n    readonly string _ignoreReason;\r\n\r\n    public IgnoreForLiveTesting(string ignoreReason = null)\r\n    {\r\n        _ignoreReason = ignoreReason;\r\n    }\r\n\r\n    public ActionTargets Targets { get; set; }\r\n\r\n    public void AfterTest(ITest test) { }\r\n\r\n    public void BeforeTest(ITest test)\r\n    {\r\n        var isLiveTesting = AppDomain.CurrentDomain.GetAssemblies()\r\n            .Any(a =&gt; a.GetName().Name == \"Microsoft.CodeAnalysis.LiveUnitTesting.Runtime\");\r\n        if (isLiveTesting)\r\n            Assert.Ignore(_ignoreReason ?? \"Ignoring this test\");\r\n    }\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>This attribute implements the <code>ITestAction<\/code> interface (which is kinda like Aspect-Oriented Programming\/AOP for NUnit, but that\u2019s a topic for a whole other blog post). It will check to see if it\u2019s being run by a <code>LiveUnitTesting<\/code> process. If it is, it instructs NUnit to ignore the test.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Furthermore, I added an optional <code>ignoreReason<\/code> to the constructor, so that you can add a helpful note to other people on your team to explain why this test should not be run with Live Unit Testing. You can use it on an integration test like so:<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-c#\">[IgnoreForLiveTesting(\"Integration Test\")]<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_summary\">Summary<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>I\u2019m not terribly pleased with this method, as it\u2019s NUnit specific, and it\u2019s not quite exactly what I was hoping for with Visual Studio Live Unit Testing. But right now I think &#8220;the juice is worth the squeeze&#8221;. Live Unit Testing is such a great feature for writing code, especially Test-Driven Development (TDD), that it\u2019s worth it to have to write and use a special NUnit attribute.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>By all means, if you know of a better way to achieve this, I want to know about it. Please leave a comment below or ping me on <a href=\"https:\/\/twitter.com\/mgroves\">Twitter @mgroves<\/a>.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>If you have questions about the Couchbase code you saw in this post, I\u2019d be happy to help. Or, you can check out the responsive and knowledgeable community on the <a href=\"https:\/\/www.couchbase.com\/forums\/c\/net-sdk\/\">Couchbase .NET SDK forum<\/a>. If you want to learn more about Couchbase, check out the <a href=\"https:\/\/www.couchbase.com\/developers\/\">Couchbase Developer Portal<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Visual Studio 2017 was just officially released. It comes with a lot of new, great stuff, but one of my favorite new features is built-in Visual Studio Live Unit Testing (available in Visual Studio 2017 Enterprise, not yet available for [&hellip;]<\/p>\n","protected":false},"author":71,"featured_media":2931,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1811,1816],"tags":[1877,1772],"ppma_author":[8937],"class_list":["post-2930","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-couchbase-server","tag-testing","tag-visual-studio"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Visual Studio Live Unit Testing: New to Visual Studio 2017<\/title>\n<meta name=\"description\" content=\"Visual Studio 2017 comes with a lot of new, great stuff, but one of my favorite new features is built-in Visual Studio Live Unit Testing\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Visual Studio Live Unit Testing: New to Visual Studio 2017\" \/>\n<meta property=\"og:description\" content=\"Visual Studio 2017 comes with a lot of new, great stuff, but one of my favorite new features is built-in Visual Studio Live Unit Testing\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-03-10T16:01:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T02:29:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/057_Hero_Testing.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Matthew Groves\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mgroves\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Matthew Groves\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/\"},\"author\":{\"name\":\"Matthew Groves\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58\"},\"headline\":\"Visual Studio Live Unit Testing: New to Visual Studio 2017\",\"datePublished\":\"2017-03-10T16:01:11+00:00\",\"dateModified\":\"2025-06-14T02:29:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/\"},\"wordCount\":1004,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/057_Hero_Testing.jpg\",\"keywords\":[\"testing\",\"Visual Studio\"],\"articleSection\":[\".NET\",\"Couchbase Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/\",\"name\":\"Visual Studio Live Unit Testing: New to Visual Studio 2017\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/057_Hero_Testing.jpg\",\"datePublished\":\"2017-03-10T16:01:11+00:00\",\"dateModified\":\"2025-06-14T02:29:17+00:00\",\"description\":\"Visual Studio 2017 comes with a lot of new, great stuff, but one of my favorite new features is built-in Visual Studio Live Unit Testing\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/057_Hero_Testing.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/057_Hero_Testing.jpg\",\"width\":960,\"height\":720,\"caption\":\"Testing - licensed through Creative Commons - https:\/\/pixabay.com\/en\/test-testing-exam-sat-act-mcat-986769\/\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Visual Studio Live Unit Testing: New to Visual Studio 2017\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58\",\"name\":\"Matthew Groves\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/ba51e6aacc53995c323a634e4502ef54\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g\",\"caption\":\"Matthew Groves\"},\"description\":\"Matthew D. Groves is a guy who loves to code. It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything. He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s. He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community. He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP.\",\"sameAs\":[\"https:\/\/crosscuttingconcerns.com\",\"https:\/\/x.com\/mgroves\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/matthew-groves\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Visual Studio Live Unit Testing: New to Visual Studio 2017","description":"Visual Studio 2017 comes with a lot of new, great stuff, but one of my favorite new features is built-in Visual Studio Live Unit Testing","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/","og_locale":"en_US","og_type":"article","og_title":"Visual Studio Live Unit Testing: New to Visual Studio 2017","og_description":"Visual Studio 2017 comes with a lot of new, great stuff, but one of my favorite new features is built-in Visual Studio Live Unit Testing","og_url":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-03-10T16:01:11+00:00","article_modified_time":"2025-06-14T02:29:17+00:00","og_image":[{"width":960,"height":720,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/057_Hero_Testing.jpg","type":"image\/jpeg"}],"author":"Matthew Groves","twitter_card":"summary_large_image","twitter_creator":"@mgroves","twitter_misc":{"Written by":"Matthew Groves","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/"},"author":{"name":"Matthew Groves","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58"},"headline":"Visual Studio Live Unit Testing: New to Visual Studio 2017","datePublished":"2017-03-10T16:01:11+00:00","dateModified":"2025-06-14T02:29:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/"},"wordCount":1004,"commentCount":3,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/057_Hero_Testing.jpg","keywords":["testing","Visual Studio"],"articleSection":[".NET","Couchbase Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/","url":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/","name":"Visual Studio Live Unit Testing: New to Visual Studio 2017","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/057_Hero_Testing.jpg","datePublished":"2017-03-10T16:01:11+00:00","dateModified":"2025-06-14T02:29:17+00:00","description":"Visual Studio 2017 comes with a lot of new, great stuff, but one of my favorite new features is built-in Visual Studio Live Unit Testing","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/057_Hero_Testing.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/03\/057_Hero_Testing.jpg","width":960,"height":720,"caption":"Testing - licensed through Creative Commons - https:\/\/pixabay.com\/en\/test-testing-exam-sat-act-mcat-986769\/"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/visual-studio-live-unit-testing-2017\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Visual Studio Live Unit Testing: New to Visual Studio 2017"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58","name":"Matthew Groves","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/ba51e6aacc53995c323a634e4502ef54","url":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","caption":"Matthew Groves"},"description":"Matthew D. Groves is a guy who loves to code. It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything. He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s. He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community. He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP.","sameAs":["https:\/\/crosscuttingconcerns.com","https:\/\/x.com\/mgroves"],"url":"https:\/\/www.couchbase.com\/blog\/author\/matthew-groves\/"}]}},"authors":[{"term_id":8937,"user_id":71,"is_guest":0,"slug":"matthew-groves","display_name":"Matthew Groves","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","author_category":"","last_name":"Groves","first_name":"Matthew","job_title":"","user_url":"https:\/\/crosscuttingconcerns.com","description":"Matthew D. Groves is a guy who loves to code.  It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything.  He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s.  He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community.  He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2930"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2930\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/2931"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2930"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}