예제 #1
0
 public void HttpPostControllerActionShouldValidateInput(string aspNetMvcVersion)
 {
     Verifier.VerifyAnalyzer(@"TestCases\HttpPostControllerActionShouldValidateInput.cs",
                             new HttpPostControllerActionShouldValidateInput(),
                             additionalReferences:  NuGetMetadataReference.MicrosoftAspNetMvc(aspNetMvcVersion));
 }
 public void MethodShouldBeNamedAccordingToSynchronicity_MVC(string mvcVersion) =>
 Verifier.VerifyAnalyzer(@"TestCases\MethodShouldBeNamedAccordingToSynchronicity.MVC.cs",
                         new MethodShouldBeNamedAccordingToSynchronicity(),
                         NuGetMetadataReference.MicrosoftAspNetMvc(mvcVersion));
 public void UriShouldNotBeHardcoded_CSharp_VirtualPath_AspNet(string aspNetMvcVersion) =>
 Verifier.VerifyAnalyzer(@"TestCases\UriShouldNotBeHardcoded.AspNet.cs",
                         new UriShouldNotBeHardcoded(),
                         additionalReferences: MetadataReferenceFacade.GetSystemWeb()
                         .Concat(NuGetMetadataReference.MicrosoftAspNetMvc(aspNetMvcVersion)));
 public void DisablingRequestValidation_CS_Disabled() =>
 Verifier.VerifyNoIssueReported(@"TestCases\Hotspots\DisablingRequestValidation.cs",
                                new CS.DisablingRequestValidation(AnalyzerConfiguration.Hotspot),
                                additionalReferences: NuGetMetadataReference.MicrosoftAspNetMvc(AspNetMvcVersion));
 public void DisablingRequestValidation_CS() =>
 Verifier.VerifyAnalyzer(@"TestCases\Hotspots\DisablingRequestValidation.cs",
                         new CS.DisablingRequestValidation(AnalyzerConfiguration.AlwaysEnabled),
                         additionalReferences: NuGetMetadataReference.MicrosoftAspNetMvc(AspNetMvcVersion));
예제 #6
0
 public static IEnumerable <MetadataReference> GetAdditionalReferences_Net46(string mvcVersion) =>
 NuGetMetadataReference.MicrosoftAspNetMvc(mvcVersion);