{"id":1379,"date":"2018-06-11T10:06:20","date_gmt":"2018-06-11T08:06:20","guid":{"rendered":"http:\/\/tpodolak.com\/blog\/?p=1379"},"modified":"2018-06-10T16:10:17","modified_gmt":"2018-06-10T14:10:17","slug":"announcing-nsubstitute-analyzers-beta","status":"publish","type":"post","link":"https:\/\/tpodolak.com\/blog\/2018\/06\/11\/announcing-nsubstitute-analyzers-beta\/","title":{"rendered":"Announcing NSubstitute.Analyzers (beta)"},"content":{"rendered":"<h3>1. Introduction<\/h3>\n<p>I am glad to announce that yesterday, together with <i>NSubstitute<\/i> team we released first beta version of <i>Roslyn<\/i> analyzers for NSubstitute &#8211; <a href=\"https:\/\/github.com\/nsubstitute\/NSubstitute.Analyzers\">NSubstitute.Analyzers<\/a>. The analyzers come in two flavors: <a href=\"https:\/\/www.nuget.org\/packages\/NSubstitute.Analyzers.CSharp\"> NSubstitute.Analyzers.CSharp<\/a> and <a href=\"https:\/\/www.nuget.org\/packages\/NSubstitute.Analyzers.VisualBasic\">NSubstitute.Analyzers.VisualBasic<\/a>. Feel free to grab them from NuGet and try them in your project.<\/p>\n<h3>2. Diagnostics<\/h3>\n<p>As for today analyzers can detect two most common misusages of <i>NSubstitute<\/i>:<\/p>\n<ul style=\"padding: 0;\n  margin-left: 1.2em;\"><\/p>\n<li>non-virtual call setup<\/li>\n<p><img decoding=\"async\" src=\"\/\/tpodolak.com\/blog\/wp-content\/uploads\/2018\/06\/announcing-nsubstitute-analyzers-beta\/NonVirtualSetup.png\" alt=\"\" height=\"495\" class=\"alignnone size-full wp-image-1389\" srcset=\"https:\/\/tpodolak.com\/blog\/wp-content\/uploads\/2018\/06\/announcing-nsubstitute-analyzers-beta\/NonVirtualSetup.png 1089w, https:\/\/tpodolak.com\/blog\/wp-content\/uploads\/2018\/06\/announcing-nsubstitute-analyzers-beta\/NonVirtualSetup-150x68.png 150w, https:\/\/tpodolak.com\/blog\/wp-content\/uploads\/2018\/06\/announcing-nsubstitute-analyzers-beta\/NonVirtualSetup-300x136.png 300w, https:\/\/tpodolak.com\/blog\/wp-content\/uploads\/2018\/06\/announcing-nsubstitute-analyzers-beta\/NonVirtualSetup-1024x465.png 1024w\" sizes=\"(max-width: 1089px) 100vw, 1089px\" \/><\/p>\n<li>Received used without following method call<\/li>\n<p><img decoding=\"async\" src=\"\/\/tpodolak.com\/blog\/wp-content\/uploads\/2018\/06\/announcing-nsubstitute-analyzers-beta\/UnusedReceived.png\" alt=\"\"  height=\"560\" class=\"alignnone size-full wp-image-1390\" srcset=\"https:\/\/tpodolak.com\/blog\/wp-content\/uploads\/2018\/06\/announcing-nsubstitute-analyzers-beta\/UnusedReceived.png 1089w, https:\/\/tpodolak.com\/blog\/wp-content\/uploads\/2018\/06\/announcing-nsubstitute-analyzers-beta\/UnusedReceived-150x77.png 150w, https:\/\/tpodolak.com\/blog\/wp-content\/uploads\/2018\/06\/announcing-nsubstitute-analyzers-beta\/UnusedReceived-300x154.png 300w, https:\/\/tpodolak.com\/blog\/wp-content\/uploads\/2018\/06\/announcing-nsubstitute-analyzers-beta\/UnusedReceived-1024x527.png 1024w\" sizes=\"(max-width: 1089px) 100vw, 1089px\" \/>\n<\/ul>\n<p>Feels free to <a href=\"https:\/\/github.com\/nsubstitute\/NSubstitute.Analyzers\/issues\">suggest<\/a> additional diagnostic you would like to have in the package.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction I am glad to announce that yesterday, together with NSubstitute team we released first beta version of Roslyn analyzers for NSubstitute &#8211; NSubstitute.Analyzers. The analyzers come in two flavors: NSubstitute.Analyzers.CSharp and NSubstitute.Analyzers.VisualBasic. Feel free to grab them from NuGet and try them in your project. 2. Diagnostics As for today analyzers can detect [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[327,335,336],"class_list":["post-1379","post","type-post","status-publish","format-standard","hentry","category-net","tag-nsubstitute","tag-nsubstitute-analyzers","tag-roslyn"],"_links":{"self":[{"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/posts\/1379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/comments?post=1379"}],"version-history":[{"count":31,"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/posts\/1379\/revisions"}],"predecessor-version":[{"id":1413,"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/posts\/1379\/revisions\/1413"}],"wp:attachment":[{"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/media?parent=1379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/categories?post=1379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/tags?post=1379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}