Permalink
Browse files

Enable StyleCop for test projects.

Fix a number of minor violations
  • Loading branch information...
1 parent 88176e4 commit d452fb0889782b1cec85c41d71ee70fc90d0f17d @marcind marcind committed Aug 16, 2012
Showing with 590 additions and 723 deletions.
  1. +311 −34 Settings.StyleCop
  2. +1 −377 src/Settings.StyleCop
  3. +1 −1 test/Microsoft.TestCommon/Microsoft/TestCommon/MediaTypeAssert.cs
  4. +0 −13 test/Microsoft.Web.Helpers.Test/AnalyticsTest.cs
  5. +2 −2 test/Microsoft.Web.Helpers.Test/TwitterTest.cs
  6. +0 −1 test/Microsoft.Web.Http.Data.Test/Controllers/CatalogController.cs
  7. +106 −69 test/Settings.StyleCop
  8. +2 −2 test/System.Net.Http.Formatting.Test/Formatting/FormDataCollectionTests.cs
  9. +2 −1 test/System.Net.Http.Formatting.Test/Formatting/FormUrlEncodedFromContentTests.cs
  10. +2 −1 test/System.Net.Http.Formatting.Test/Formatting/FormUrlEncodedFromUriQueryTests.cs
  11. +0 −3 test/System.Net.Http.Formatting.Test/Formatting/JsonNetSerializationTest.cs
  12. +4 −4 test/System.Net.Http.Formatting.Test/Formatting/MediaTypeFormatterTestBase.cs
  13. +0 −1 test/System.Net.Http.Formatting.Test/Formatting/QueryStringMappingTests.cs
  14. +0 −1 test/System.Net.Http.Formatting.Test/Formatting/RequestHeaderMappingTests.cs
  15. +1 −1 test/System.Net.Http.Formatting.Test/Handlers/ProgressStreamTest.cs
  16. +6 −6 test/System.Net.Http.Formatting.Test/Handlers/ProgressWriteAsyncResultTest.cs
  17. +1 −1 test/System.Net.Http.Formatting.Test/HttpClientFactoryTest.cs
  18. +10 −10 test/System.Net.Http.Formatting.Test/Mocks/MockContentNegotiator.cs
  19. +1 −1 test/System.Net.Http.Formatting.Test/Mocks/MockMediaTypeFormatter.cs
  20. +3 −3 test/System.Web.Helpers.Test/CryptoTest.cs
  21. +3 −3 test/System.Web.Helpers.Test/HelperResultTest.cs
  22. +1 −1 test/System.Web.Helpers.Test/WebCacheTest.cs
  23. +0 −2 test/System.Web.Helpers.Test/WebGridTest.cs
  24. +2 −2 test/System.Web.Http.Integration.Test/Controllers/ApiControllerActionSelectorTest.cs
  25. +1 −2 test/System.Web.Http.Integration.Test/Tracing/MemoryTraceWriter.cs
  26. +2 −2 test/System.Web.Http.SelfHost.Test/DeeplyNestedTypeTests.cs
  27. +2 −2 test/System.Web.Http.Test/Controllers/ApiControllerTest.cs
  28. +1 −1 test/System.Web.Http.Test/Controllers/HttpParameterBindingTest.cs
  29. +5 −10 test/System.Web.Http.Test/Controllers/ParameterBindingExtensionsTest.cs
  30. +0 −1 test/System.Web.Http.Test/Controllers/ReflectedHttpActionDescriptorTest.cs
  31. +0 −1 test/System.Web.Http.Test/Filters/ExceptionFilterAttributeTest.cs
  32. +2 −1 test/System.Web.Http.Test/HttpResponseExceptionTest.cs
  33. +4 −4 test/System.Web.Http.Test/HttpServerTest.cs
  34. +0 −1 test/System.Web.Http.Test/Internal/CollectionModelBinderUtilTest.cs
  35. +0 −1 test/System.Web.Http.Test/ModelBinding/Binders/KeyValuePairModelBinderUtilTest.cs
  36. +2 −2 test/System.Web.Http.Test/ModelBinding/Binders/MutableObjectModelBinderTest.cs
  37. +23 −23 test/System.Web.Http.Test/ModelBinding/DefaultActionValueBinderTest.cs
  38. +0 −12 test/System.Web.Http.Test/Services/ControllerServicesTests.cs
  39. +9 −9 test/System.Web.Http.Test/Tracing/FormattingUtilitiesTest.cs
  40. +1 −1 test/System.Web.Http.Test/Tracing/TraceManagerTest.cs
  41. +5 −9 test/System.Web.Http.Test/Tracing/Tracers/BufferedMediaTypeFormatterTracerTest.cs
  42. +2 −3 test/System.Web.Http.Test/Tracing/Tracers/ExceptionFilterTracerTest.cs
  43. +1 −1 test/System.Web.Http.Test/Tracing/Tracers/FilterTracerTest.cs
  44. +1 −1 test/System.Web.Http.Test/Tracing/Tracers/FormatterParameterBindingTracerTest.cs
  45. +4 −8 test/System.Web.Http.Test/Tracing/Tracers/HttpActionBindingTracerTest.cs
  46. +0 −1 test/System.Web.Http.Test/Tracing/Tracers/HttpControllerDescriptorTracerTest.cs
  47. +6 −5 test/System.Web.Http.Test/Tracing/Tracers/MessageHandlerTracerTest.cs
  48. +11 −18 test/System.Web.Http.Test/Tracing/Tracers/ReadWriteMediaTypeFormatterTracerTestBase.cs
  49. +0 −1 test/System.Web.Http.Test/Validation/Providers/DataAnnotationsModelValidatorProviderTest.cs
  50. +1 −4 test/System.Web.Http.Test/Validation/Providers/InvalidModelValidatorProviderTest.cs
  51. +1 −1 test/System.Web.Http.Test/ValueProviders/Providers/QueryStringValueProviderTest.cs
  52. +1 −1 test/System.Web.Http.WebHost.Test/Routing/HttpRequestMessageWrapperTest.cs
  53. +1 −1 test/System.Web.Mvc.Test/ExpressionUtil/Test/HoistingExpressionVisitorTest.cs
  54. +1 −1 test/System.Web.Mvc.Test/Html/Test/DefaultEditorTemplatesTest.cs
  55. +22 −22 test/System.Web.Mvc.Test/Html/Test/ValidationExtensionsTest.cs
  56. +0 −8 test/System.Web.Mvc.Test/Test/TypeCacheUtilTest.cs
  57. +1 −1 test/System.Web.Razor.Test/Parser/CSharp/CSharpErrorTest.cs
  58. +0 −2 test/System.Web.Razor.Test/Parser/Html/HtmlAttributeTest.cs
  59. +2 −2 test/System.Web.Razor.Test/Text/TextReaderExtensionsTest.cs
  60. +0 −1 test/System.Web.WebPages.Deployment.Test/WebPagesDeploymentTest.cs
  61. +18 −18 test/System.Web.WebPages.Test/Html/ValidationHelperTest.cs
  62. +0 −1 test/System.Web.WebPages.Test/Validation/ValidationHelperTest.cs
  63. +1 −0 test/System.Web.WebPages.Test/WebPage/Utils.cs
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,381 +1,5 @@
<StyleCopSettings Version="105">
<GlobalSettings>
- <StringProperty Name="MergeSettingsFiles">NoMerge</StringProperty>
+ <StringProperty Name="MergeSettingsFiles">Parent</StringProperty>
</GlobalSettings>
- <Parsers>
- <Parser ParserId="StyleCop.CSharp.CsParser">
- <ParserSettings>
- <BooleanProperty Name="AnalyzeDesignerFiles">False</BooleanProperty>
- </ParserSettings>
- </Parser>
- </Parsers>
- <Analyzers>
- <Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
- <Rules>
- <Rule Name="ElementsMustBeDocumented">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="PartialElementsMustBeDocumented">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="EnumerationItemsMustBeDocumented">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="DocumentationMustContainValidXml">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ElementDocumentationMustHaveSummary">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="PartialElementDocumentationMustHaveSummary">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ElementDocumentationMustHaveSummaryText">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="PartialElementDocumentationMustHaveSummaryText">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ElementDocumentationMustNotHaveDefaultSummary">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ElementParametersMustBeDocumented">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ElementParameterDocumentationMustMatchElementParameters">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ElementParameterDocumentationMustDeclareParameterName">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ElementParameterDocumentationMustHaveText">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ElementReturnValueMustBeDocumented">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ElementReturnValueDocumentationMustHaveText">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="VoidReturnValueMustNotBeDocumented">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="GenericTypeParametersMustBeDocumented">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="GenericTypeParametersMustBeDocumentedPartialClass">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="GenericTypeParameterDocumentationMustMatchTypeParameters">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="GenericTypeParameterDocumentationMustDeclareParameterName">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="GenericTypeParameterDocumentationMustHaveText">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="PropertySummaryDocumentationMustMatchAccessors">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="PropertySummaryDocumentationMustOmitSetAccessorWithRestrictedAccess">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ElementDocumentationMustNotBeCopiedAndPasted">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="SingleLineCommentsMustNotUseDocumentationStyleSlashes">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="DocumentationTextMustNotBeEmpty">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="DocumentationTextMustContainWhitespace">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="DocumentationMustMeetCharacterPercentage">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="IncludedDocumentationXPathDoesNotExist">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="IncludeNodeDoesNotContainValidFileAndPath">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="InheritDocMustBeUsedWithInheritingClass">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="FileMustHaveHeader">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="FileHeaderMustShowCopyright">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="FileHeaderMustHaveCopyrightText">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="FileHeaderFileNameDocumentationMustMatchTypeName">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ConstructorSummaryDocumentationMustBeginWithStandardText">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="DestructorSummaryDocumentationMustBeginWithStandardText">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="DocumentationHeadersMustNotContainBlankLines">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="FileHeaderMustContainFileName">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="FileHeaderMustHaveValidCompanyText">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- </Rules>
- <AnalyzerSettings>
- <BooleanProperty Name="IgnorePrivates">True</BooleanProperty>
- <BooleanProperty Name="IgnoreInternals">True</BooleanProperty>
- </AnalyzerSettings>
- </Analyzer>
- <Analyzer AnalyzerId="StyleCop.CSharp.LayoutRules">
- <Rules>
- <Rule Name="ClosingCurlyBracketMustBeFollowedByBlankLine">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ElementsMustBeSeparatedByBlankLine">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="SingleLineCommentMustBePrecededByBlankLine">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="SingleLineCommentsMustNotBeFollowedByBlankLine">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="AllAccessorsMustBeMultiLineOrSingleLine">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- </Rules>
- <AnalyzerSettings />
- </Analyzer>
- <Analyzer AnalyzerId="StyleCop.CSharp.MaintainabilityRules">
- <Rules>
- <Rule Name="DebugAssertMustProvideMessageText">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="FileMayOnlyContainASingleClass">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="StatementMustNotUseUnnecessaryParenthesis">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="CodeAnalysisSuppressionMustHaveJustification">
- <RuleSettings>
- <BooleanProperty Name="Enabled">True</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="FieldsMustBePrivate">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- </Rules>
- <AnalyzerSettings />
- </Analyzer>
- <Analyzer AnalyzerId="StyleCop.CSharp.NamingRules">
- <Rules>
- <Rule Name="FieldNamesMustNotBeginWithUnderscore">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- </Rules>
- <AnalyzerSettings>
- <CollectionProperty Name="Hungarian">
- <Value>as</Value>
- <Value>do</Value>
- <Value>id</Value>
- <Value>if</Value>
- <Value>in</Value>
- <Value>is</Value>
- <Value>my</Value>
- <Value>no</Value>
- <Value>on</Value>
- <Value>to</Value>
- <Value>ui</Value>
- </CollectionProperty>
- </AnalyzerSettings>
- </Analyzer>
- <Analyzer AnalyzerId="StyleCop.CSharp.OrderingRules">
- <Rules>
- <Rule Name="UsingDirectivesMustBePlacedWithinNamespace">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ElementsMustBeOrderedByAccess">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="StaticElementsMustAppearBeforeInstanceElements">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ConstantsMustAppearBeforeFields">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- </Rules>
- <AnalyzerSettings />
- </Analyzer>
- <Analyzer AnalyzerId="StyleCop.CSharp.ReadabilityRules">
- <Rules>
- <Rule Name="PrefixLocalCallsWithThis">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="SplitParametersMustStartOnLineAfterDeclaration">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ParametersMustBeOnSameLineOrSeparateLines">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="UseBuiltInTypeAlias">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ParameterMustFollowComma">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- <Rule Name="ParameterMustNotSpanMultipleLines">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- </Rules>
- <AnalyzerSettings />
- </Analyzer>
- <Analyzer AnalyzerId="StyleCop.CSharp.SpacingRules">
- <Rules>
- <Rule Name="SingleLineCommentsMustBeginWithSingleSpace">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
- </Rules>
- <AnalyzerSettings />
- </Analyzer>
- </Analyzers>
</StyleCopSettings>
@@ -47,7 +47,7 @@ public void AreEqual(string expected, MediaTypeHeaderValue actual, string errorM
if (!String.IsNullOrEmpty(expected) || actual != null)
{
Assert.NotNull(expected);
- MediaTypeHeaderValue expectedMediaType = new MediaTypeHeaderValue(expected); ;
+ MediaTypeHeaderValue expectedMediaType = new MediaTypeHeaderValue(expected);
Assert.Equal(0, new MediaTypeHeaderValueComparer().Compare(expectedMediaType, actual));
}
}
Oops, something went wrong.

0 comments on commit d452fb0

Please sign in to comment.