{"id":3120,"date":"2020-02-21T15:40:42","date_gmt":"2020-02-21T14:40:42","guid":{"rendered":"http:\/\/www.capri-soft.de\/blog\/?p=3120"},"modified":"2020-02-24T08:10:47","modified_gmt":"2020-02-24T07:10:47","slug":"c-net-create-standard-unit-test-project-and-run-a-mstest-unit-test-project-under-with-standard-visual-studio-integration-using-microsoft-visualstudio-qualitytools-unittestframework","status":"publish","type":"post","link":"https:\/\/www.capri-soft.de\/blog\/?p=3120","title":{"rendered":"C# .NET : Create standard Unit Test Project and run a MsTest Unit Test Project with Standard Visual Studio Integration using Microsoft.VisualStudio.QualityTools.UnitTestFramework"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Intention<\/h2>\n\n\n\n<p>Testing makes me happy \ud83d\ude42 &#8230; <\/p>\n\n\n\n<p>There are 4 common Unit Test Frameworks available as NuGet-Packages: <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>MsTest (Standard when creating a normal test project under VS2013)<\/li><li>MsTest v2<\/li><li>NUnit<\/li><li>xUnit<\/li><\/ul>\n\n\n\n<p>This short instruction shows how to set up the integrated standard Unit Test Framework without installing packages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Approach<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Right-click solution explorer and choose Add -&gt; New Project<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"130\" data-attachment-id=\"3122\" data-permalink=\"https:\/\/www.capri-soft.de\/blog\/?attachment_id=3122\" data-orig-file=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-3.png?fit=643%2C176&amp;ssl=1\" data-orig-size=\"643,176\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-3\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-3.png?fit=474%2C130&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-3.png?resize=474%2C130&#038;ssl=1\" alt=\"\" class=\"wp-image-3122\" srcset=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-3.png?w=643&amp;ssl=1 643w, https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-3.png?resize=300%2C82&amp;ssl=1 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Under Visual C# choose Test -&gt; Unit Test Project, change your name and click &#8222;ok&#8220; on the lower right<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"265\" data-attachment-id=\"3123\" data-permalink=\"https:\/\/www.capri-soft.de\/blog\/?attachment_id=3123\" data-orig-file=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-4.png?fit=804%2C450&amp;ssl=1\" data-orig-size=\"804,450\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-4\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-4.png?fit=474%2C265&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-4.png?resize=474%2C265&#038;ssl=1\" alt=\"\" class=\"wp-image-3123\" srcset=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-4.png?w=804&amp;ssl=1 804w, https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-4.png?resize=300%2C168&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-4.png?resize=768%2C430&amp;ssl=1 768w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Write Assert.isTrue(true); to have a passing test for test \ud83d\ude42 <\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"446\" height=\"308\" data-attachment-id=\"3124\" data-permalink=\"https:\/\/www.capri-soft.de\/blog\/?attachment_id=3124\" data-orig-file=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-5.png?fit=446%2C308&amp;ssl=1\" data-orig-size=\"446,308\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-5\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-5.png?fit=446%2C308&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-5.png?resize=446%2C308&#038;ssl=1\" alt=\"\" class=\"wp-image-3124\" srcset=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-5.png?w=446&amp;ssl=1 446w, https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-5.png?resize=300%2C207&amp;ssl=1 300w\" sizes=\"auto, (max-width: 446px) 100vw, 446px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>In the Visual Studio 2013 main menu choose &#8222;Test -&gt; Window -&gt; Test explorer&#8220; (this is the part i was searching for a while -&gt; How to start the tests)<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"137\" data-attachment-id=\"3125\" data-permalink=\"https:\/\/www.capri-soft.de\/blog\/?attachment_id=3125\" data-orig-file=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-6.png?fit=731%2C211&amp;ssl=1\" data-orig-size=\"731,211\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-6\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-6.png?fit=474%2C137&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-6.png?resize=474%2C137&#038;ssl=1\" alt=\"\" class=\"wp-image-3125\" srcset=\"https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-6.png?w=731&amp;ssl=1 731w, https:\/\/i0.wp.com\/www.capri-soft.de\/blog\/wp-content\/uploads\/2020\/02\/image-6.png?resize=300%2C87&amp;ssl=1 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>After adding the Test-Explorer choose &#8222;Run All&#8220; to run the Unit Test.<\/li><\/ul>\n\n\n\n<p>Please Note: If you want to test another project with the test project, you have to Add a reference to it by right-clicking references -&gt; Add&#8230; <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution<\/h2>\n\n\n\n<p>Testing makes you happy \ud83d\ude42 <\/p>\n<iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.capri-soft.de%2Fblog%2F%3Fp%3D3120&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light\" scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\" style=\"border:none; overflow:hidden; width:450px;margin-top:5px;\"><\/iframe>","protected":false},"excerpt":{"rendered":"<p>Intention Testing makes me happy \ud83d\ude42 &#8230; There are 4 common Unit Test Frameworks available as NuGet-Packages: MsTest (Standard when creating a normal test project under VS2013) MsTest v2 NUnit xUnit This short instruction shows how to set up the integrated standard Unit Test Framework without installing packages. Approach Right-click solution explorer and choose Add &hellip; <a href=\"https:\/\/www.capri-soft.de\/blog\/?p=3120\" class=\"more-link\"><span class=\"screen-reader-text\">C# .NET : Create standard Unit Test Project and run a MsTest Unit Test Project with Standard Visual Studio Integration using Microsoft.VisualStudio.QualityTools.UnitTestFramework<\/span> weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-3120","post","type-post","status-publish","format-standard","hentry","category-allgemein"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4yGeN-Ok","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3120"}],"version-history":[{"count":3,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3120\/revisions"}],"predecessor-version":[{"id":3128,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3120\/revisions\/3128"}],"wp:attachment":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}