diff --git a/src/Microsoft.AspNet.Razor/Editor/AutoCompleteEditHandler.cs b/src/Microsoft.AspNet.Razor/Editor/AutoCompleteEditHandler.cs index a1a0b5cf72..9d96d7aed2 100644 --- a/src/Microsoft.AspNet.Razor/Editor/AutoCompleteEditHandler.cs +++ b/src/Microsoft.AspNet.Razor/Editor/AutoCompleteEditHandler.cs @@ -50,7 +50,7 @@ namespace Microsoft.AspNet.Razor.Parser.SyntaxTree var other = obj as AutoCompleteEditHandler; return base.Equals(obj) && other != null && - String.Equals(other.AutoCompleteString, AutoCompleteString, StringComparison.Ordinal) && + string.Equals(other.AutoCompleteString, AutoCompleteString, StringComparison.Ordinal) && AutoCompleteAtEndOfSpan == other.AutoCompleteAtEndOfSpan; } diff --git a/src/Microsoft.AspNet.Razor/Editor/ImplicitExpressionEditHandler.cs b/src/Microsoft.AspNet.Razor/Editor/ImplicitExpressionEditHandler.cs index 642797b12b..51c010e8c9 100644 --- a/src/Microsoft.AspNet.Razor/Editor/ImplicitExpressionEditHandler.cs +++ b/src/Microsoft.AspNet.Razor/Editor/ImplicitExpressionEditHandler.cs @@ -30,7 +30,7 @@ namespace Microsoft.AspNet.Razor.Editor public override string ToString() { - return String.Format(CultureInfo.InvariantCulture, "{0};ImplicitExpression[{1}];K{2}", base.ToString(), AcceptTrailingDot ? "ATD" : "RTD", Keywords.Count); + return string.Format(CultureInfo.InvariantCulture, "{0};ImplicitExpression[{1}];K{2}", base.ToString(), AcceptTrailingDot ? "ATD" : "RTD", Keywords.Count); } public override bool Equals(object obj) @@ -134,7 +134,7 @@ namespace Microsoft.AspNet.Razor.Editor { // Do not need to worry about other punctuation, just looking for double '.' (after change) return change.NewLength == 1 && - !String.IsNullOrEmpty(target.Content) && + !string.IsNullOrEmpty(target.Content) && target.Content.Last() == '.' && change.NewText == "." && change.OldLength == 0; @@ -187,7 +187,7 @@ namespace Microsoft.AspNet.Razor.Editor private static bool RemainingIsWhitespace(Span target, TextChange change) { var offset = (change.OldPosition - target.Start.AbsoluteIndex) + change.OldLength; - return String.IsNullOrWhiteSpace(target.Content.Substring(offset)); + return string.IsNullOrWhiteSpace(target.Content.Substring(offset)); } private PartialParseResult HandleDotlessCommitInsertion(Span target) diff --git a/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs b/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs index 7d5585f7ce..4d3c84f757 100644 --- a/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs +++ b/src/Microsoft.AspNet.Razor/Editor/RazorEditorTrace.cs @@ -45,7 +45,7 @@ namespace Microsoft.AspNet.Razor.Editor // No Trace in CoreCLR Trace.WriteLine(RazorResources.FormatTrace_Format( - String.Format(CultureInfo.CurrentCulture, format, args))); + string.Format(CultureInfo.CurrentCulture, format, args))); #endif } } diff --git a/src/Microsoft.AspNet.Razor/Editor/SpanEditHandler.cs b/src/Microsoft.AspNet.Razor/Editor/SpanEditHandler.cs index d9b6b8279f..94cb59dfe0 100644 --- a/src/Microsoft.AspNet.Razor/Editor/SpanEditHandler.cs +++ b/src/Microsoft.AspNet.Razor/Editor/SpanEditHandler.cs @@ -163,7 +163,7 @@ namespace Microsoft.AspNet.Razor.Editor public override string ToString() { - return GetType().Name + ";Accepts:" + AcceptedCharacters + ((EditorHints == EditorHints.None) ? String.Empty : (";Hints: " + EditorHints.ToString())); + return GetType().Name + ";Accepts:" + AcceptedCharacters + ((EditorHints == EditorHints.None) ? string.Empty : (";Hints: " + EditorHints.ToString())); } public override bool Equals(object obj) diff --git a/src/Microsoft.AspNet.Razor/Generator/AddImportCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/AddImportCodeGenerator.cs index b22eb474d4..c43fd89a11 100644 --- a/src/Microsoft.AspNet.Razor/Generator/AddImportCodeGenerator.cs +++ b/src/Microsoft.AspNet.Razor/Generator/AddImportCodeGenerator.cs @@ -22,7 +22,7 @@ namespace Microsoft.AspNet.Razor.Generator { var ns = Namespace; - if (!String.IsNullOrEmpty(ns) && Char.IsWhiteSpace(ns[0])) + if (!string.IsNullOrEmpty(ns) && Char.IsWhiteSpace(ns[0])) { ns = ns.Substring(1); } @@ -39,7 +39,7 @@ namespace Microsoft.AspNet.Razor.Generator { var other = obj as AddImportCodeGenerator; return other != null && - String.Equals(Namespace, other.Namespace, StringComparison.Ordinal) && + string.Equals(Namespace, other.Namespace, StringComparison.Ordinal) && NamespaceKeywordLength == other.NamespaceKeywordLength; } diff --git a/src/Microsoft.AspNet.Razor/Generator/AttributeBlockCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/AttributeBlockCodeGenerator.cs index a9873ecb87..32f8116e75 100644 --- a/src/Microsoft.AspNet.Razor/Generator/AttributeBlockCodeGenerator.cs +++ b/src/Microsoft.AspNet.Razor/Generator/AttributeBlockCodeGenerator.cs @@ -39,14 +39,14 @@ namespace Microsoft.AspNet.Razor.Generator public override string ToString() { - return String.Format(CultureInfo.CurrentCulture, "Attr:{0},{1:F},{2:F}", Name, Prefix, Suffix); + return string.Format(CultureInfo.CurrentCulture, "Attr:{0},{1:F},{2:F}", Name, Prefix, Suffix); } public override bool Equals(object obj) { var other = obj as AttributeBlockCodeGenerator; return other != null && - String.Equals(other.Name, Name, StringComparison.Ordinal) && + string.Equals(other.Name, Name, StringComparison.Ordinal) && Equals(other.Prefix, Prefix) && Equals(other.Suffix, Suffix); } diff --git a/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpCodeWriter.cs b/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpCodeWriter.cs index 8bb0d5a0da..15b569fd86 100644 --- a/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpCodeWriter.cs +++ b/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpCodeWriter.cs @@ -64,7 +64,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp public CSharpCodeWriter WriteVariableDeclaration(string type, string name, string value) { Write(type).Write(" ").Write(name); - if (!String.IsNullOrEmpty(value)) + if (!string.IsNullOrEmpty(value)) { Write(" = ").Write(value); } @@ -145,7 +145,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp public CSharpCodeWriter WriteUsing(string name, bool endLine) { - Write(String.Format("using {0}", name)); + Write(string.Format("using {0}", name)); if (endLine) { diff --git a/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpPaddingBuilder.cs b/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpPaddingBuilder.cs index f1affbd444..30669ab38c 100644 --- a/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpPaddingBuilder.cs +++ b/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpPaddingBuilder.cs @@ -37,7 +37,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp if (_host.DesignTimeMode && padding > 0 && target.Previous.Kind == SpanKind.Transition && // target.Previous is guaranteed to not be null if you have padding. - String.Equals(target.Previous.Content, SyntaxConstants.TransitionString, StringComparison.Ordinal)) + string.Equals(target.Previous.Content, SyntaxConstants.TransitionString, StringComparison.Ordinal)) { padding--; } @@ -113,7 +113,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp // When scanning previous spans we need to be break down the spans with spaces. The parser combines // whitespace into existing spans so you'll see tabs, newlines etc. within spans. We only care about // the \t in existing spans. - var previousContent = firstSpanInLine.Previous.Content ?? String.Empty; + var previousContent = firstSpanInLine.Previous.Content ?? string.Empty; var lastNewLineIndex = previousContent.LastIndexOfAny(_newLineChars); diff --git a/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/Visitors/CSharpCodeVisitor.cs b/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/Visitors/CSharpCodeVisitor.cs index 1aceb1466c..4742c9b2f8 100644 --- a/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/Visitors/CSharpCodeVisitor.cs +++ b/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/Visitors/CSharpCodeVisitor.cs @@ -81,7 +81,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp protected override void Visit(SetLayoutChunk chunk) { - if (!Context.Host.DesignTimeMode && !String.IsNullOrEmpty(Context.Host.GeneratedClassContext.LayoutPropertyName)) + if (!Context.Host.DesignTimeMode && !string.IsNullOrEmpty(Context.Host.GeneratedClassContext.LayoutPropertyName)) { Writer.Write(Context.Host.GeneratedClassContext.LayoutPropertyName) .Write(" = ") @@ -110,7 +110,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp protected override void Visit(ResolveUrlChunk chunk) { - if (!Context.Host.DesignTimeMode && String.IsNullOrEmpty(chunk.Url)) + if (!Context.Host.DesignTimeMode && string.IsNullOrEmpty(chunk.Url)) { return; } @@ -124,7 +124,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp Writer.WriteStartInstrumentationContext(Context, chunk.Association, isLiteral: false); } - if (!String.IsNullOrEmpty(chunk.Url) && !Context.Host.DesignTimeMode) + if (!string.IsNullOrEmpty(chunk.Url) && !Context.Host.DesignTimeMode) { if (Context.ExpressionRenderingMode == ExpressionRenderingMode.WriteToOutput) { @@ -320,7 +320,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp return; } - if (!String.IsNullOrEmpty(Context.TargetWriterName)) + if (!string.IsNullOrEmpty(Context.TargetWriterName)) { Writer.WriteStartMethodInvocation(Context.Host.GeneratedClassContext.WriteAttributeToMethodName) .Write(Context.TargetWriterName) diff --git a/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/Visitors/CSharpTypeMemberVisitor.cs b/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/Visitors/CSharpTypeMemberVisitor.cs index 32ceca9cba..5d44479528 100644 --- a/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/Visitors/CSharpTypeMemberVisitor.cs +++ b/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/Visitors/CSharpTypeMemberVisitor.cs @@ -19,9 +19,9 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp protected override void Visit(TypeMemberChunk chunk) { - if (!String.IsNullOrEmpty(chunk.Code)) + if (!string.IsNullOrEmpty(chunk.Code)) { - _csharpCodeVisitor.CreateCodeMapping(String.Empty, chunk.Code, chunk); + _csharpCodeVisitor.CreateCodeMapping(string.Empty, chunk.Code, chunk); } } } diff --git a/src/Microsoft.AspNet.Razor/Generator/DynamicAttributeBlockCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/DynamicAttributeBlockCodeGenerator.cs index 1dc4bf0a3b..ce02a0086e 100644 --- a/src/Microsoft.AspNet.Razor/Generator/DynamicAttributeBlockCodeGenerator.cs +++ b/src/Microsoft.AspNet.Razor/Generator/DynamicAttributeBlockCodeGenerator.cs @@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Razor.Generator public override string ToString() { - return String.Format(CultureInfo.CurrentCulture, "DynAttr:{0:F}", Prefix); + return string.Format(CultureInfo.CurrentCulture, "DynAttr:{0:F}", Prefix); } public override bool Equals(object obj) diff --git a/src/Microsoft.AspNet.Razor/Generator/LiteralAttributeCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/LiteralAttributeCodeGenerator.cs index 09fcdc1bb4..6fbc2983e5 100644 --- a/src/Microsoft.AspNet.Razor/Generator/LiteralAttributeCodeGenerator.cs +++ b/src/Microsoft.AspNet.Razor/Generator/LiteralAttributeCodeGenerator.cs @@ -50,11 +50,11 @@ namespace Microsoft.AspNet.Razor.Generator { if (ValueGenerator == null) { - return String.Format(CultureInfo.CurrentCulture, "LitAttr:{0:F},{1:F}", Prefix, Value); + return string.Format(CultureInfo.CurrentCulture, "LitAttr:{0:F},{1:F}", Prefix, Value); } else { - return String.Format(CultureInfo.CurrentCulture, "LitAttr:{0:F},", Prefix, ValueGenerator); + return string.Format(CultureInfo.CurrentCulture, "LitAttr:{0:F},", Prefix, ValueGenerator); } } diff --git a/src/Microsoft.AspNet.Razor/Generator/RazorCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/RazorCodeGenerator.cs index b5bb7d0955..ee0a2d0d43 100644 --- a/src/Microsoft.AspNet.Razor/Generator/RazorCodeGenerator.cs +++ b/src/Microsoft.AspNet.Razor/Generator/RazorCodeGenerator.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Razor.Generator protected RazorCodeGenerator(string className, string rootNamespaceName, string sourceFileName, RazorEngineHost host) { - if (String.IsNullOrEmpty(className)) + if (string.IsNullOrEmpty(className)) { throw new ArgumentException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "className"); } @@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Razor.Generator ClassName = className; RootNamespaceName = rootNamespaceName; SourceFileName = sourceFileName; - GenerateLinePragmas = String.IsNullOrEmpty(SourceFileName) ? false : true; + GenerateLinePragmas = string.IsNullOrEmpty(SourceFileName) ? false : true; Host = host; } diff --git a/src/Microsoft.AspNet.Razor/Generator/ResolveUrlCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/ResolveUrlCodeGenerator.cs index 2eea7d2616..0f96a6d1d6 100644 --- a/src/Microsoft.AspNet.Razor/Generator/ResolveUrlCodeGenerator.cs +++ b/src/Microsoft.AspNet.Razor/Generator/ResolveUrlCodeGenerator.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNet.Razor.Generator public override void GenerateCode(Span target, CodeGeneratorContext context) { // Check if the host supports it - if (String.IsNullOrEmpty(context.Host.GeneratedClassContext.ResolveUrlMethodName)) + if (string.IsNullOrEmpty(context.Host.GeneratedClassContext.ResolveUrlMethodName)) { // Nope, just use the default MarkupCodeGenerator behavior new MarkupCodeGenerator().GenerateCode(target, context); diff --git a/src/Microsoft.AspNet.Razor/Generator/SectionCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/SectionCodeGenerator.cs index 88b541e5c5..26ab0fb8a9 100644 --- a/src/Microsoft.AspNet.Razor/Generator/SectionCodeGenerator.cs +++ b/src/Microsoft.AspNet.Razor/Generator/SectionCodeGenerator.cs @@ -34,7 +34,7 @@ namespace Microsoft.AspNet.Razor.Generator var other = obj as SectionCodeGenerator; return other != null && base.Equals(other) && - String.Equals(SectionName, other.SectionName, StringComparison.Ordinal); + string.Equals(SectionName, other.SectionName, StringComparison.Ordinal); } public override int GetHashCode() diff --git a/src/Microsoft.AspNet.Razor/Generator/SetBaseTypeCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/SetBaseTypeCodeGenerator.cs index 7f62b0ab83..57d2739b59 100644 --- a/src/Microsoft.AspNet.Razor/Generator/SetBaseTypeCodeGenerator.cs +++ b/src/Microsoft.AspNet.Razor/Generator/SetBaseTypeCodeGenerator.cs @@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Razor.Generator { var other = obj as SetBaseTypeCodeGenerator; return other != null && - String.Equals(BaseType, other.BaseType, StringComparison.Ordinal); + string.Equals(BaseType, other.BaseType, StringComparison.Ordinal); } public override int GetHashCode() diff --git a/src/Microsoft.AspNet.Razor/Generator/SetLayoutCodeGenerator.cs b/src/Microsoft.AspNet.Razor/Generator/SetLayoutCodeGenerator.cs index 36edcfa207..6b56d2e16c 100644 --- a/src/Microsoft.AspNet.Razor/Generator/SetLayoutCodeGenerator.cs +++ b/src/Microsoft.AspNet.Razor/Generator/SetLayoutCodeGenerator.cs @@ -28,7 +28,7 @@ namespace Microsoft.AspNet.Razor.Generator public override bool Equals(object obj) { var other = obj as SetLayoutCodeGenerator; - return other != null && String.Equals(other.LayoutPath, LayoutPath, StringComparison.Ordinal); + return other != null && string.Equals(other.LayoutPath, LayoutPath, StringComparison.Ordinal); } public override int GetHashCode() diff --git a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs index 799b5fb18b..c4ab2e4713 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.Directives.cs @@ -89,7 +89,7 @@ namespace Microsoft.AspNet.Razor.Parser IEnumerable ws = ReadWhile(IsSpacingToken(includeNewLines: true, includeComments: false)); // Get the section name - var sectionName = String.Empty; + var sectionName = string.Empty; if (!Required(CSharpSymbolType.Identifier, errorIfNotFound: true, errorBase: RazorResources.FormatParseError_Unexpected_Character_At_Section_Name_Start)) @@ -236,7 +236,7 @@ namespace Microsoft.AspNet.Razor.Parser protected void AssertDirective(string directive) { Assert(CSharpSymbolType.Identifier); - Debug.Assert(String.Equals(CurrentSymbol.Content, directive, StringComparison.Ordinal)); + Debug.Assert(string.Equals(CurrentSymbol.Content, directive, StringComparison.Ordinal)); } protected void InheritsDirectiveCore() diff --git a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs index d03e883e8e..1c4119e9dc 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpCodeParser.cs @@ -508,7 +508,7 @@ namespace Microsoft.AspNet.Razor.Parser // If necessary, put an empty-content marker symbol here if (Span.Symbols.Count == 0) { - Accept(new CSharpSymbol(CurrentLocation, String.Empty, CSharpSymbolType.Unknown)); + Accept(new CSharpSymbol(CurrentLocation, string.Empty, CSharpSymbolType.Unknown)); } // Output the content span and then capture the ")" diff --git a/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs b/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs index 2285f73339..e93794d391 100644 --- a/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs +++ b/src/Microsoft.AspNet.Razor/Parser/CSharpLanguageCharacteristics.cs @@ -94,7 +94,7 @@ namespace Microsoft.AspNet.Razor.Parser public override CSharpSymbol CreateMarkerSymbol(SourceLocation location) { - return new CSharpSymbol(location, String.Empty, CSharpSymbolType.Unknown); + return new CSharpSymbol(location, string.Empty, CSharpSymbolType.Unknown); } public override CSharpSymbolType GetKnownSymbolType(KnownSymbolType type) diff --git a/src/Microsoft.AspNet.Razor/Parser/ConditionalAttributeCollapser.cs b/src/Microsoft.AspNet.Razor/Parser/ConditionalAttributeCollapser.cs index 3ce6fff494..c66d9fbd07 100644 --- a/src/Microsoft.AspNet.Razor/Parser/ConditionalAttributeCollapser.cs +++ b/src/Microsoft.AspNet.Razor/Parser/ConditionalAttributeCollapser.cs @@ -26,7 +26,7 @@ namespace Microsoft.AspNet.Razor.Parser protected override SyntaxTreeNode RewriteBlock(BlockBuilder parent, Block block) { // Collect the content of this node - var content = String.Concat(block.Children.Cast().Select(s => s.Content)); + var content = string.Concat(block.Children.Cast().Select(s => s.Content)); // Create a new span containing this content var span = new SpanBuilder(); diff --git a/src/Microsoft.AspNet.Razor/Parser/HtmlLanguageCharacteristics.cs b/src/Microsoft.AspNet.Razor/Parser/HtmlLanguageCharacteristics.cs index bfb8910be3..adbcdde333 100644 --- a/src/Microsoft.AspNet.Razor/Parser/HtmlLanguageCharacteristics.cs +++ b/src/Microsoft.AspNet.Razor/Parser/HtmlLanguageCharacteristics.cs @@ -101,7 +101,7 @@ namespace Microsoft.AspNet.Razor.Parser public override HtmlSymbol CreateMarkerSymbol(SourceLocation location) { - return new HtmlSymbol(location, String.Empty, HtmlSymbolType.Unknown); + return new HtmlSymbol(location, string.Empty, HtmlSymbolType.Unknown); } public override HtmlSymbolType GetKnownSymbolType(KnownSymbolType type) diff --git a/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Block.cs b/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Block.cs index 7b1d69034f..263a6ce21d 100644 --- a/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Block.cs +++ b/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Block.cs @@ -265,7 +265,7 @@ namespace Microsoft.AspNet.Razor.Parser private bool CData() { - if (CurrentSymbol.Type == HtmlSymbolType.Text && String.Equals(CurrentSymbol.Content, "cdata", StringComparison.OrdinalIgnoreCase)) + if (CurrentSymbol.Type == HtmlSymbolType.Text && string.Equals(CurrentSymbol.Content, "cdata", StringComparison.OrdinalIgnoreCase)) { if (AcceptAndMoveNext()) { @@ -521,7 +521,7 @@ namespace Microsoft.AspNet.Razor.Parser } // Capture the suffix - LocationTagged suffix = new LocationTagged(String.Empty, CurrentLocation); + LocationTagged suffix = new LocationTagged(string.Empty, CurrentLocation); if (quote != HtmlSymbolType.Unknown && At(quote)) { suffix = CurrentSymbol.GetContent(); @@ -967,7 +967,7 @@ namespace Microsoft.AspNet.Razor.Parser while (tags.Count > 0) { currentTag = tags.Pop(); - if (String.Equals(tagName, currentTag.Item1.Content, StringComparison.OrdinalIgnoreCase)) + if (string.Equals(tagName, currentTag.Item1.Content, StringComparison.OrdinalIgnoreCase)) { // Matched the tag return true; diff --git a/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Section.cs b/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Section.cs index 9ff8d4531f..39eb8adaeb 100644 --- a/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Section.cs +++ b/src/Microsoft.AspNet.Razor/Parser/HtmlMarkupParser.Section.cs @@ -90,14 +90,14 @@ namespace Microsoft.AspNet.Razor.Parser private bool AtEnd(string[] nestingSequenceComponents) { EnsureCurrent(); - if (String.Equals(CurrentSymbol.Content, nestingSequenceComponents[0], Comparison)) + if (string.Equals(CurrentSymbol.Content, nestingSequenceComponents[0], Comparison)) { var bookmark = CurrentSymbol.Start.AbsoluteIndex; try { foreach (string component in nestingSequenceComponents) { - if (!EndOfFile && !String.Equals(CurrentSymbol.Content, component, Comparison)) + if (!EndOfFile && !string.Equals(CurrentSymbol.Content, component, Comparison)) { return false; } @@ -143,7 +143,7 @@ namespace Microsoft.AspNet.Razor.Parser position + sequence.Length <= CurrentSymbol.Content.Length) { var possibleStart = CurrentSymbol.Content.Substring(position, sequence.Length); - if (String.Equals(possibleStart, sequence, Comparison)) + if (string.Equals(possibleStart, sequence, Comparison)) { // Capture the current symbol and "put it back" (really we just want to clear CurrentSymbol) var bookmark = Context.Source.Position; @@ -159,7 +159,7 @@ namespace Microsoft.AspNet.Razor.Parser var postSequence = pair.Item2; // Accept the first chunk (up to the nesting sequence we just saw) - if (!String.IsNullOrEmpty(preSequence.Content)) + if (!string.IsNullOrEmpty(preSequence.Content)) { Accept(preSequence); } diff --git a/src/Microsoft.AspNet.Razor/Parser/ParserHelpers.cs b/src/Microsoft.AspNet.Razor/Parser/ParserHelpers.cs index 809c772138..50547e2001 100644 --- a/src/Microsoft.AspNet.Razor/Parser/ParserHelpers.cs +++ b/src/Microsoft.AspNet.Razor/Parser/ParserHelpers.cs @@ -23,7 +23,7 @@ namespace Microsoft.AspNet.Razor.Parser public static bool IsNewLine(string value) { return (value.Length == 1 && (IsNewLine(value[0]))) || - (String.Equals(value, "\r\n", StringComparison.Ordinal)); + (string.Equals(value, "\r\n", StringComparison.Ordinal)); } // Returns true if the character is Whitespace and NOT a newline diff --git a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs index 506ece1a89..3f78ac47f5 100644 --- a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs +++ b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Block.cs @@ -104,7 +104,7 @@ namespace Microsoft.AspNet.Razor.Parser.SyntaxTree public override string ToString() { - return String.Format(CultureInfo.CurrentCulture, "{0} Block at {1}::{2} (Gen:{3})", Type, Start, Length, CodeGenerator); + return string.Format(CultureInfo.CurrentCulture, "{0} Block at {1}::{2} (Gen:{3})", Type, Start, Length, CodeGenerator); } public override bool Equals(object obj) diff --git a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Span.cs b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Span.cs index bbee4fc12a..6537bb6099 100644 --- a/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Span.cs +++ b/src/Microsoft.AspNet.Razor/Parser/SyntaxTree/Span.cs @@ -96,7 +96,7 @@ namespace Microsoft.AspNet.Razor.Parser.SyntaxTree builder.Append(" Gen: <"); builder.Append(CodeGenerator.ToString()); builder.Append("> {"); - builder.Append(String.Join(";", Symbols.GroupBy(sym => sym.GetType()).Select(grp => String.Concat(grp.Key.Name, ":", grp.Count())))); + builder.Append(string.Join(";", Symbols.GroupBy(sym => sym.GetType()).Select(grp => string.Concat(grp.Key.Name, ":", grp.Count())))); builder.Append("}"); return builder.ToString(); } @@ -129,7 +129,7 @@ namespace Microsoft.AspNet.Razor.Parser.SyntaxTree Kind.Equals(other.Kind) && Start.Equals(other.Start) && EditHandler.Equals(other.EditHandler) && - String.Equals(other.Content, Content, StringComparison.Ordinal); + string.Equals(other.Content, Content, StringComparison.Ordinal); } public override bool Equals(object obj) diff --git a/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs b/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs index b023f3f416..085a097397 100644 --- a/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs +++ b/src/Microsoft.AspNet.Razor/Parser/TokenizerBackedParser.Helpers.cs @@ -375,7 +375,7 @@ namespace Microsoft.AspNet.Razor.Parser AcceptWhile(sym => Equals(type, sym.Type)); } - // We want to avoid array allocations and enumeration where possible, so we use the same technique as String.Format + // We want to avoid array allocations and enumeration where possible, so we use the same technique as string.Format protected internal void AcceptWhile(TSymbolType type1, TSymbolType type2) { AcceptWhile(sym => Equals(type1, sym.Type) || Equals(type2, sym.Type)); @@ -396,7 +396,7 @@ namespace Microsoft.AspNet.Razor.Parser AcceptWhile(sym => !Equals(type, sym.Type)); } - // We want to avoid array allocations and enumeration where possible, so we use the same technique as String.Format + // We want to avoid array allocations and enumeration where possible, so we use the same technique as string.Format protected internal void AcceptUntil(TSymbolType type1, TSymbolType type2) { AcceptWhile(sym => !Equals(type1, sym.Type) && !Equals(type2, sym.Type)); diff --git a/src/Microsoft.AspNet.Razor/RazorEditorParser.cs b/src/Microsoft.AspNet.Razor/RazorEditorParser.cs index c72ea73b11..3d0068341d 100644 --- a/src/Microsoft.AspNet.Razor/RazorEditorParser.cs +++ b/src/Microsoft.AspNet.Razor/RazorEditorParser.cs @@ -73,7 +73,7 @@ namespace Microsoft.AspNet.Razor { throw new ArgumentNullException("host"); } - if (String.IsNullOrEmpty(sourceFileName)) + if (string.IsNullOrEmpty(sourceFileName)) { throw new ArgumentException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "sourceFileName"); } @@ -141,7 +141,7 @@ namespace Microsoft.AspNet.Razor var result = PartialParseResult.Rejected; // If there isn't already a parse underway, try partial-parsing - var changeString = String.Empty; + var changeString = string.Empty; using (_parser.SynchronizeMainThreadState()) { // Capture the string value of the change while we're synchronized diff --git a/src/Microsoft.AspNet.Razor/RazorError.cs b/src/Microsoft.AspNet.Razor/RazorError.cs index b584885be7..d83f650d68 100644 --- a/src/Microsoft.AspNet.Razor/RazorError.cs +++ b/src/Microsoft.AspNet.Razor/RazorError.cs @@ -41,7 +41,7 @@ namespace Microsoft.AspNet.Razor public override string ToString() { - return String.Format(CultureInfo.CurrentCulture, "Error @ {0}({2}) - [{1}]", Location, Message, Length); + return string.Format(CultureInfo.CurrentCulture, "Error @ {0}({2}) - [{1}]", Location, Message, Length); } public override bool Equals(object obj) @@ -57,7 +57,7 @@ namespace Microsoft.AspNet.Razor public bool Equals(RazorError other) { - return String.Equals(other.Message, Message, StringComparison.Ordinal) && + return string.Equals(other.Message, Message, StringComparison.Ordinal) && Location.Equals(other.Location); } } diff --git a/src/Microsoft.AspNet.Razor/RazorResources.resx b/src/Microsoft.AspNet.Razor/RazorResources.resx index cb104d2385..c206b3cc51 100644 --- a/src/Microsoft.AspNet.Razor/RazorResources.resx +++ b/src/Microsoft.AspNet.Razor/RazorResources.resx @@ -198,7 +198,7 @@ Instead, wrap the contents of the block in "{{}}": "{0}" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{{" are valid. - "{{" is an escape sequence for String.Format, when outputted to the user it will be displayed as "{" + "{{" is an escape sequence for string.Format, when outputted to the user it will be displayed as "{" End of file or an unexpected character was reached before the "{0}" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("<br />") or have matching end tags ("<p>Hello</p>"). If you intended to display a "<" character, use the "&lt;" HTML entity. diff --git a/src/Microsoft.AspNet.Razor/RazorTemplateEngine.cs b/src/Microsoft.AspNet.Razor/RazorTemplateEngine.cs index 1e38b4eb9e..d181bd8f4d 100644 --- a/src/Microsoft.AspNet.Razor/RazorTemplateEngine.cs +++ b/src/Microsoft.AspNet.Razor/RazorTemplateEngine.cs @@ -22,7 +22,7 @@ namespace Microsoft.AspNet.Razor { private const int BufferSize = 1024; public static readonly string DefaultClassName = "Template"; - public static readonly string DefaultNamespace = String.Empty; + public static readonly string DefaultNamespace = string.Empty; /// /// Constructs a new RazorTemplateEngine with the specified host @@ -41,11 +41,11 @@ namespace Microsoft.AspNet.Razor /// /// The RazorEngineHost which defines the environment in which the generated template code will live /// - public RazorEngineHost Host { get; private set; } + public RazorEngineHost Host { get; } public ParserResults ParseTemplate(ITextBuffer input) { - return ParseTemplate(input, null); + return ParseTemplate(input, cancelToken: null); } /// @@ -63,7 +63,10 @@ namespace Microsoft.AspNet.Razor /// The input text to parse /// A token used to cancel the parser /// The resulting parse tree - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Input object would be disposed if we dispose the wrapper. We don't own the input so we don't want to dispose it")] + [SuppressMessage( + "Microsoft.Reliability", "CA2000:Dispose objects before losing scope", + Justification = "Input object would be disposed if we dispose the wrapper. We don't own the input so " + + "we don't want to dispose it")] public ParserResults ParseTemplate(ITextBuffer input, CancellationToken? cancelToken) { return ParseTemplateCore(input.ToDocument(), sourceFileName: null, cancelToken: cancelToken); @@ -76,15 +79,20 @@ namespace Microsoft.AspNet.Razor return ParseTemplateCore(new SeekableTextReader(input), sourceFileName, cancelToken: null); } - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Input object would be disposed if we dispose the wrapper. We don't own the input so we don't want to dispose it")] + [SuppressMessage( + "Microsoft.Reliability", + "CA2000:Dispose objects before losing scope", + Justification = "Input object would be disposed if we dispose the wrapper. We don't own the input so " + + "we don't want to dispose it")] public ParserResults ParseTemplate(TextReader input, CancellationToken? cancelToken) { return ParseTemplateCore(new SeekableTextReader(input), sourceFileName: null, cancelToken: cancelToken); } - protected internal virtual ParserResults ParseTemplateCore(ITextDocument input, - string sourceFileName, - CancellationToken? cancelToken) + protected internal virtual ParserResults ParseTemplateCore( + ITextDocument input, + string sourceFileName, + CancellationToken? cancelToken) { // Construct the parser var parser = CreateParser(sourceFileName); @@ -94,17 +102,22 @@ namespace Microsoft.AspNet.Razor public GeneratorResults GenerateCode(ITextBuffer input) { - return GenerateCode(input, null, null, null, null); + return GenerateCode(input, className: null, rootNamespace: null, sourceFileName: null, cancelToken: null); } public GeneratorResults GenerateCode(ITextBuffer input, CancellationToken? cancelToken) { - return GenerateCode(input, null, null, null, cancelToken); + return GenerateCode( + input, + className: null, + rootNamespace: null, + sourceFileName: null, + cancelToken: cancelToken); } public GeneratorResults GenerateCode(ITextBuffer input, string className, string rootNamespace, string sourceFileName) { - return GenerateCode(input, className, rootNamespace, sourceFileName, null); + return GenerateCode(input, className, rootNamespace, sourceFileName, cancelToken: null); } /// @@ -128,31 +141,50 @@ namespace Microsoft.AspNet.Razor /// The namespace in which the generated class will reside, overriding whatever is specified in the Host. The default value (defined in the Host) can be used by providing null for this argument /// The file name to use in line pragmas, usually the original Razor file, overriding whatever is specified in the Host. The default value (defined in the Host) can be used by providing null for this argument /// The resulting parse tree AND generated code. - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Input object would be disposed if we dispose the wrapper. We don't own the input so we don't want to dispose it")] - public GeneratorResults GenerateCode(ITextBuffer input, string className, string rootNamespace, string sourceFileName, CancellationToken? cancelToken) + [SuppressMessage( + "Microsoft.Reliability", + "CA2000:Dispose objects before losing scope", + Justification = "Input object would be disposed if we dispose the wrapper. We don't own the input so " + + "we don't want to dispose it")] + public GeneratorResults GenerateCode( + ITextBuffer input, + string className, + string rootNamespace, + string sourceFileName, + CancellationToken? cancelToken) { - return GenerateCodeCore(input.ToDocument(), - className, - rootNamespace, - sourceFileName, - checksum: null, - cancelToken: cancelToken); + return GenerateCodeCore( + input.ToDocument(), + className, + rootNamespace, + sourceFileName, + checksum: null, + cancelToken: cancelToken); } // See GenerateCode override which takes ITextBuffer, and BufferingTextReader for details. public GeneratorResults GenerateCode(TextReader input) { - return GenerateCode(input, null, null, null, null); + return GenerateCode(input, className: null, rootNamespace: null, sourceFileName: null, cancelToken: null); } public GeneratorResults GenerateCode(TextReader input, CancellationToken? cancelToken) { - return GenerateCode(input, null, null, null, cancelToken); + return GenerateCode( + input, + className: null, + rootNamespace: null, + sourceFileName: null, + cancelToken: cancelToken); } - public GeneratorResults GenerateCode(TextReader input, string className, string rootNamespace, string sourceFileName) + public GeneratorResults GenerateCode( + TextReader input, + string className, + + string rootNamespace, string sourceFileName) { - return GenerateCode(input, className, rootNamespace, sourceFileName, null); + return GenerateCode(input, className, rootNamespace, sourceFileName, cancelToken: null); } /// @@ -170,10 +202,11 @@ namespace Microsoft.AspNet.Razor /// generation. The checksum is used for producing the #pragma checksum line pragma required for /// debugging. /// - public GeneratorResults GenerateCode([NotNull] Stream inputStream, - string className, - string rootNamespace, - string sourceFileName) + public GeneratorResults GenerateCode( + [NotNull] Stream inputStream, + string className, + string rootNamespace, + string sourceFileName) { MemoryStream memoryStream = null; string checksum = null; @@ -197,19 +230,22 @@ namespace Microsoft.AspNet.Razor inputStream.Position = 0; } - using (var reader = new StreamReader(inputStream, - Encoding.UTF8, - detectEncodingFromByteOrderMarks: true, - bufferSize: BufferSize, - leaveOpen: true)) + using (var reader = + new StreamReader( + inputStream, + Encoding.UTF8, + detectEncodingFromByteOrderMarks: true, + bufferSize: BufferSize, + leaveOpen: true)) { var seekableStream = new SeekableTextReader(reader); - return GenerateCodeCore(seekableStream, - className, - rootNamespace, - sourceFileName, - checksum, - cancelToken: null); + return GenerateCodeCore( + seekableStream, + className, + rootNamespace, + sourceFileName, + checksum, + cancelToken: null); } } finally @@ -221,23 +257,34 @@ namespace Microsoft.AspNet.Razor } } - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Input object would be disposed if we dispose the wrapper. We don't own the input so we don't want to dispose it")] - public GeneratorResults GenerateCode(TextReader input, string className, string rootNamespace, string sourceFileName, CancellationToken? cancelToken) + [SuppressMessage( + "Microsoft.Reliability", + "CA2000:Dispose objects before losing scope", + Justification = "Input object would be disposed if we dispose the wrapper. We don't own the input so " + + "we don't want to dispose it")] + public GeneratorResults GenerateCode( + TextReader input, + string className, + string rootNamespace, + string sourceFileName, + CancellationToken? cancelToken) { - return GenerateCodeCore(new SeekableTextReader(input), - className, - rootNamespace, - sourceFileName, - checksum: null, - cancelToken: cancelToken); + return GenerateCodeCore( + new SeekableTextReader(input), + className, + rootNamespace, + sourceFileName, + checksum: null, + cancelToken: cancelToken); } - protected internal virtual GeneratorResults GenerateCodeCore(ITextDocument input, - string className, - string rootNamespace, - string sourceFileName, - string checksum, - CancellationToken? cancelToken) + protected internal virtual GeneratorResults GenerateCodeCore( + ITextDocument input, + string className, + string rootNamespace, + string sourceFileName, + string checksum, + CancellationToken? cancelToken) { className = (className ?? Host.DefaultClassName) ?? DefaultClassName; rootNamespace = (rootNamespace ?? Host.DefaultNamespace) ?? DefaultNamespace; @@ -261,7 +308,10 @@ namespace Microsoft.AspNet.Razor return new GeneratorResults(results, builderResult, codeBuilderContext.CodeTreeBuilder.CodeTree); } - protected internal virtual RazorCodeGenerator CreateCodeGenerator(string className, string rootNamespace, string sourceFileName) + protected internal virtual RazorCodeGenerator CreateCodeGenerator( + string className, + string rootNamespace, + string sourceFileName) { return Host.DecorateCodeGenerator( Host.CodeLanguage.CreateCodeGenerator(className, rootNamespace, sourceFileName, Host)); @@ -272,9 +322,10 @@ namespace Microsoft.AspNet.Razor var codeParser = Host.CodeLanguage.CreateCodeParser(); var markupParser = Host.CreateMarkupParser(); - var parser = new RazorParser(Host.DecorateCodeParser(codeParser), - Host.DecorateMarkupParser(markupParser), - Host.TagHelperDescriptorResolver) + var parser = new RazorParser( + Host.DecorateCodeParser(codeParser), + Host.DecorateMarkupParser(markupParser), + Host.TagHelperDescriptorResolver) { DesignTimeMode = Host.DesignTimeMode }; @@ -284,8 +335,7 @@ namespace Microsoft.AspNet.Razor protected internal virtual CodeBuilder CreateCodeBuilder(CodeBuilderContext context) { - return Host.DecorateCodeBuilder(Host.CodeLanguage.CreateCodeBuilder(context), - context); + return Host.DecorateCodeBuilder(Host.CodeLanguage.CreateCodeBuilder(context), context); } private static string ComputeChecksum(Stream inputStream) diff --git a/src/Microsoft.AspNet.Razor/SourceLocation.cs b/src/Microsoft.AspNet.Razor/SourceLocation.cs index 11b851282b..6ee98d7a43 100644 --- a/src/Microsoft.AspNet.Razor/SourceLocation.cs +++ b/src/Microsoft.AspNet.Razor/SourceLocation.cs @@ -37,7 +37,7 @@ namespace Microsoft.AspNet.Razor public override string ToString() { - return String.Format( + return string.Format( CultureInfo.CurrentCulture, "({0}:{1},{2})", AbsoluteIndex, @@ -58,9 +58,10 @@ namespace Microsoft.AspNet.Razor public bool Equals(SourceLocation other) { - return AbsoluteIndex == other.AbsoluteIndex && - LineIndex == other.LineIndex && - CharacterIndex == other.CharacterIndex; + return + AbsoluteIndex == other.AbsoluteIndex && + LineIndex == other.LineIndex && + CharacterIndex == other.CharacterIndex; } public int CompareTo(SourceLocation other) diff --git a/src/Microsoft.AspNet.Razor/Text/LocationTagged.cs b/src/Microsoft.AspNet.Razor/Text/LocationTagged.cs index d319eb5f79..da1693037c 100644 --- a/src/Microsoft.AspNet.Razor/Text/LocationTagged.cs +++ b/src/Microsoft.AspNet.Razor/Text/LocationTagged.cs @@ -59,7 +59,7 @@ namespace Microsoft.AspNet.Razor.Text public string ToString(string format, IFormatProvider formatProvider) { - if (String.IsNullOrEmpty(format)) + if (string.IsNullOrEmpty(format)) { format = "P"; } @@ -70,7 +70,7 @@ namespace Microsoft.AspNet.Razor.Text switch (format.ToUpperInvariant()) { case "F": - return String.Format(formatProvider, "{0}@{1}", Value, Location); + return string.Format(formatProvider, "{0}@{1}", Value, Location); default: return Value.ToString(); } diff --git a/src/Microsoft.AspNet.Razor/Text/TextChange.cs b/src/Microsoft.AspNet.Razor/Text/TextChange.cs index 96f9d108b6..f2c7de183d 100644 --- a/src/Microsoft.AspNet.Razor/Text/TextChange.cs +++ b/src/Microsoft.AspNet.Razor/Text/TextChange.cs @@ -154,7 +154,7 @@ namespace Microsoft.AspNet.Razor.Text public override string ToString() { - return String.Format(CultureInfo.CurrentCulture, "({0}:{1}) \"{3}\" -> ({0}:{2}) \"{4}\"", OldPosition, OldLength, NewLength, OldText, NewText); + return string.Format(CultureInfo.CurrentCulture, "({0}:{1}) \"{3}\" -> ({0}:{2}) \"{4}\"", OldPosition, OldLength, NewLength, OldText, NewText); } /// @@ -181,7 +181,7 @@ namespace Microsoft.AspNet.Razor.Text // Optimization for the common case of one char inserts, in this case we don't even need to seek the buffer. if (length == 0) { - return String.Empty; + return string.Empty; } var oldPosition = buffer.Position; diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolBase.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolBase.cs index ee157fce35..858b540ca8 100644 --- a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolBase.cs +++ b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolBase.cs @@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Razor.Tokenizer.Symbols SymbolBase other = obj as SymbolBase; return other != null && Start.Equals(other.Start) && - String.Equals(Content, other.Content, StringComparison.Ordinal) && + string.Equals(Content, other.Content, StringComparison.Ordinal) && Type.Equals(other.Type); } @@ -55,7 +55,7 @@ namespace Microsoft.AspNet.Razor.Tokenizer.Symbols public override string ToString() { - return String.Format(CultureInfo.InvariantCulture, "{0} {1} - [{2}]", Start, Type, Content); + return string.Format(CultureInfo.InvariantCulture, "{0} {1} - [{2}]", Start, Type, Content); } public void OffsetStart(SourceLocation documentStart) diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolExtensions.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolExtensions.cs index 13523fe4de..3de42bfce2 100644 --- a/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolExtensions.cs +++ b/src/Microsoft.AspNet.Razor/Tokenizer/Symbols/SymbolExtensions.cs @@ -27,11 +27,11 @@ namespace Microsoft.AspNet.Razor.Tokenizer.Symbols { if (symbols.Any()) { - return new LocationTagged(String.Concat(symbols.Select(s => s.Content)), spanStart + symbols.First().Start); + return new LocationTagged(string.Concat(symbols.Select(s => s.Content)), spanStart + symbols.First().Start); } else { - return new LocationTagged(String.Empty, spanStart); + return new LocationTagged(string.Empty, spanStart); } } diff --git a/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs b/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs index 9a55f98d55..70cf4d68ea 100644 --- a/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs +++ b/src/Microsoft.AspNet.Razor/Tokenizer/Tokenizer.cs @@ -327,7 +327,7 @@ namespace Microsoft.AspNet.Razor.Tokenizer Debug.Assert(CurrentCharacter == current, "CurrentCharacter Assumption violated", "Assumed that the current character would be {0}, but it is actually {1}", current, CurrentCharacter); #else - Debug.Assert(CurrentCharacter == current, String.Format("CurrentCharacter Assumption violated. Assumed that the current character would be {0}, but it is actually {1}", current, CurrentCharacter)); + Debug.Assert(CurrentCharacter == current, string.Format("CurrentCharacter Assumption violated. Assumed that the current character would be {0}, but it is actually {1}", current, CurrentCharacter)); #endif } @@ -345,7 +345,7 @@ namespace Microsoft.AspNet.Razor.Tokenizer public string DebugDisplay { - get { return String.Format(CultureInfo.InvariantCulture, "[{0}] [{1}] [{2}]", _read.ToString(), CurrentCharacter, Remaining); } + get { return string.Format(CultureInfo.InvariantCulture, "[{0}] [{1}] [{2}]", _read.ToString(), CurrentCharacter, Remaining); } } public string Remaining diff --git a/test/Microsoft.AspNet.Razor.Test/Editor/RazorEditorParserTest.cs b/test/Microsoft.AspNet.Razor.Test/Editor/RazorEditorParserTest.cs index f78e62de42..7881e70d01 100644 --- a/test/Microsoft.AspNet.Razor.Test/Editor/RazorEditorParserTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Editor/RazorEditorParserTest.cs @@ -133,7 +133,7 @@ namespace Microsoft.AspNet.Razor.Test.Editor }; // Act - parser.CheckForStructureChanges(new TextChange(0, 0, new StringTextBuffer(String.Empty), input.Length, input)); + parser.CheckForStructureChanges(new TextChange(0, 0, new StringTextBuffer(string.Empty), input.Length, input)); // Assert MiscUtils.DoWithTimeoutIfNotDebugging(parseComplete.Wait); @@ -162,7 +162,7 @@ namespace Microsoft.AspNet.Razor.Test.Editor parseComplete.Set(); }; - Assert.Equal(PartialParseResult.Rejected, parser.CheckForStructureChanges(new TextChange(0, 0, new StringTextBuffer(String.Empty), 12, original))); + Assert.Equal(PartialParseResult.Rejected, parser.CheckForStructureChanges(new TextChange(0, 0, new StringTextBuffer(string.Empty), 12, original))); MiscUtils.DoWithTimeoutIfNotDebugging(parseComplete.Wait); // Wait for the parse to finish parseComplete.Reset(); @@ -178,7 +178,7 @@ namespace Microsoft.AspNet.Razor.Test.Editor private TextChange CreateDummyChange() { - return new TextChange(0, 0, new StringTextBuffer(String.Empty), 3, new StringTextBuffer("foo")); + return new TextChange(0, 0, new StringTextBuffer(string.Empty), 3, new StringTextBuffer("foo")); } private static RazorEditorParser CreateClientParser() diff --git a/test/Microsoft.AspNet.Razor.Test/Framework/ParserTestBase.cs b/test/Microsoft.AspNet.Razor.Test/Framework/ParserTestBase.cs index f1ababa4fe..7ab7f523b7 100644 --- a/test/Microsoft.AspNet.Razor.Test/Framework/ParserTestBase.cs +++ b/test/Microsoft.AspNet.Razor.Test/Framework/ParserTestBase.cs @@ -218,7 +218,7 @@ namespace Microsoft.AspNet.Razor.Test.Framework { if (results != null && results.Document != null) { - WriteTraceLine(String.Empty); + WriteTraceLine(string.Empty); WriteTraceLine("Actual Parse Tree:"); WriteNode(0, results.Document); } @@ -491,7 +491,7 @@ namespace Microsoft.AspNet.Razor.Test.Framework [Conditional("PARSER_TRACE")] private static void WriteTraceLine(string format, params object[] args) { - Trace.WriteLine(String.Format(format, args)); + Trace.WriteLine(string.Format(format, args)); } protected virtual Block CreateSimpleBlockAndSpan(string spanContent, BlockType blockType, SpanKind spanType, AcceptedCharacters acceptedCharacters = AcceptedCharacters.Any) diff --git a/test/Microsoft.AspNet.Razor.Test/Framework/RawTextSymbol.cs b/test/Microsoft.AspNet.Razor.Test/Framework/RawTextSymbol.cs index 29ad9117f5..521f84b6f6 100644 --- a/test/Microsoft.AspNet.Razor.Test/Framework/RawTextSymbol.cs +++ b/test/Microsoft.AspNet.Razor.Test/Framework/RawTextSymbol.cs @@ -57,7 +57,7 @@ namespace Microsoft.AspNet.Razor.Test.Framework public override string ToString() { - return String.Format(CultureInfo.InvariantCulture, "{0} RAW - [{1}]", Start, Content); + return string.Format(CultureInfo.InvariantCulture, "{0} RAW - [{1}]", Start, Content); } internal void CalculateStart(Span prev) diff --git a/test/Microsoft.AspNet.Razor.Test/Framework/TestSpanBuilder.cs b/test/Microsoft.AspNet.Razor.Test/Framework/TestSpanBuilder.cs index 9a23533196..57cd53e618 100644 --- a/test/Microsoft.AspNet.Razor.Test/Framework/TestSpanBuilder.cs +++ b/test/Microsoft.AspNet.Razor.Test/Framework/TestSpanBuilder.cs @@ -19,12 +19,12 @@ namespace Microsoft.AspNet.Razor.Test.Framework public static UnclassifiedCodeSpanConstructor EmptyCSharp(this SpanFactory self) { return new UnclassifiedCodeSpanConstructor( - self.Span(SpanKind.Code, new CSharpSymbol(self.LocationTracker.CurrentLocation, String.Empty, CSharpSymbolType.Unknown))); + self.Span(SpanKind.Code, new CSharpSymbol(self.LocationTracker.CurrentLocation, string.Empty, CSharpSymbolType.Unknown))); } public static SpanConstructor EmptyHtml(this SpanFactory self) { - return self.Span(SpanKind.Markup, new HtmlSymbol(self.LocationTracker.CurrentLocation, String.Empty, HtmlSymbolType.Unknown)) + return self.Span(SpanKind.Markup, new HtmlSymbol(self.LocationTracker.CurrentLocation, string.Empty, HtmlSymbolType.Unknown)) .With(new MarkupCodeGenerator()); } diff --git a/test/Microsoft.AspNet.Razor.Test/Generator/CSharpRazorCodeGeneratorTest.cs b/test/Microsoft.AspNet.Razor.Test/Generator/CSharpRazorCodeGeneratorTest.cs index 393313498a..4260d4ae0e 100644 --- a/test/Microsoft.AspNet.Razor.Test/Generator/CSharpRazorCodeGeneratorTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Generator/CSharpRazorCodeGeneratorTest.cs @@ -51,7 +51,7 @@ namespace Microsoft.AspNet.Razor.Test.Generator [Fact] public void ConstructorAllowsEmptyRootNamespaceName() { - new CSharpRazorCodeGenerator("Foo", String.Empty, TestPhysicalPath, CreateHost()); + new CSharpRazorCodeGenerator("Foo", string.Empty, TestPhysicalPath, CreateHost()); } [Fact] diff --git a/test/Microsoft.AspNet.Razor.Test/Generator/RazorCodeGeneratorTest.cs b/test/Microsoft.AspNet.Razor.Test/Generator/RazorCodeGeneratorTest.cs index d95d886fca..34405888b0 100644 --- a/test/Microsoft.AspNet.Razor.Test/Generator/RazorCodeGeneratorTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Generator/RazorCodeGeneratorTest.cs @@ -173,11 +173,11 @@ namespace Microsoft.AspNet.Razor.Test.Generator using (var source = TestFile.Create(sourceLocation).OpenRead()) { var sourceFile = NormalizeNewLines(source); - var sourceFileName = generatePragmas ? String.Format("{0}.{1}", name, FileExtension) : null; + var sourceFileName = generatePragmas ? string.Format("{0}.{1}", name, FileExtension) : null; results = engine.GenerateCode(sourceFile, className: name, rootNamespace: TestRootNamespaceName, sourceFileName: sourceFileName); } // Only called if GENERATE_BASELINES is set, otherwise compiled out. - BaselineWriter.WriteBaseline(String.Format(@"test\Microsoft.AspNet.Razor.Test\TestFiles\CodeGenerator\{0}\Output\{1}.{2}", LanguageName, baselineName, BaselineExtension), results.GeneratedCode); + BaselineWriter.WriteBaseline(string.Format(@"test\Microsoft.AspNet.Razor.Test\TestFiles\CodeGenerator\{0}\Output\{1}.{2}", LanguageName, baselineName, BaselineExtension), results.GeneratedCode); #if !GENERATE_BASELINES var textOutput = results.GeneratedCode; diff --git a/test/Microsoft.AspNet.Razor.Test/Generator/TestSpan.cs b/test/Microsoft.AspNet.Razor.Test/Generator/TestSpan.cs index afbcf48401..4d1da1a7af 100644 --- a/test/Microsoft.AspNet.Razor.Test/Generator/TestSpan.cs +++ b/test/Microsoft.AspNet.Razor.Test/Generator/TestSpan.cs @@ -34,7 +34,7 @@ namespace Microsoft.AspNet.Razor.Test.Generator public override string ToString() { - return String.Format("{0}: {1}-{2}", Kind, Start, End); + return string.Format("{0}: {1}-{2}", Kind, Start, End); } public override bool Equals(object obj) diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpAutoCompleteTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpAutoCompleteTest.cs index 08c5f430f4..da626fd309 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpAutoCompleteTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpAutoCompleteTest.cs @@ -119,7 +119,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.Markup("

").Accepts(AcceptedCharacters.None)), new MarkupTagBlock( Factory.Markup("

").Accepts(AcceptedCharacters.None))), - Factory.Span(SpanKind.Code, new CSharpSymbol(Factory.LocationTracker.CurrentLocation, String.Empty, CSharpSymbolType.Unknown)) + Factory.Span(SpanKind.Code, new CSharpSymbol(Factory.LocationTracker.CurrentLocation, string.Empty, CSharpSymbolType.Unknown)) .With(new StatementCodeGenerator()) ), new RazorError(RazorResources.FormatParseError_Expected_EndOfBlock_Before_EOF(RazorResources.BlockName_Code, "}", "{"), diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpBlockTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpBlockTest.cs index 02c3be7a7d..858e270fc1 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpBlockTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpBlockTest.cs @@ -772,7 +772,7 @@ catch(bar) { baz(); }", BlockType.Statement, SpanKind.Code); private void NamespaceImportTest(string content, string expectedNS, AcceptedCharacters acceptedCharacters = AcceptedCharacters.None, string errorMessage = null, SourceLocation? location = null) { var errors = new RazorError[0]; - if (!String.IsNullOrEmpty(errorMessage) && location.HasValue) + if (!string.IsNullOrEmpty(errorMessage) && location.HasValue) { errors = new RazorError[] { diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpErrorTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpErrorTest.cs index 96ca9d2579..ab87c584a7 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpErrorTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpErrorTest.cs @@ -588,10 +588,10 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp [Fact] public void ParseBlockCorrectlyRecoversFromMissingCloseParenInExpressionWithinCode() { - ParseBlockTest(@"{String.Format(}", + ParseBlockTest(@"{string.Format(}", new StatementBlock( Factory.MetaCode("{").Accepts(AcceptedCharacters.None), - Factory.Code("String.Format(") + Factory.Code("string.Format(") .AsStatement(), new MarkupBlock( BlockFactory.MarkupTagBlock("", AcceptedCharacters.None), diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpLayoutDirectiveTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpLayoutDirectiveTest.cs index 8954b6f300..d7bac05c50 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpLayoutDirectiveTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpLayoutDirectiveTest.cs @@ -62,7 +62,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.MetaCode("layout ").Accepts(AcceptedCharacters.None), Factory.EmptyCSharp() .AsMetaCode() - .With(new SetLayoutCodeGenerator(String.Empty)) + .With(new SetLayoutCodeGenerator(string.Empty)) .WithEditorHints(EditorHints.VirtualPath | EditorHints.LayoutPage) ) ); diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpRazorCommentsTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpRazorCommentsTest.cs index bafca7df42..b3055f8d41 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpRazorCommentsTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpRazorCommentsTest.cs @@ -25,7 +25,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .Accepts(AcceptedCharacters.None), Factory.Span(SpanKind.Comment, new HtmlSymbol( Factory.LocationTracker.CurrentLocation, - String.Empty, + string.Empty, HtmlSymbolType.Unknown)) .Accepts(AcceptedCharacters.Any))), new RazorError(RazorResources.ParseError_RazorComment_Not_Terminated, 0, 0, 0)); @@ -44,7 +44,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .Accepts(AcceptedCharacters.None), Factory.Span(SpanKind.Comment, new HtmlSymbol( Factory.LocationTracker.CurrentLocation, - String.Empty, + string.Empty, HtmlSymbolType.Unknown)) .Accepts(AcceptedCharacters.Any), Factory.MetaMarkup("*", HtmlSymbolType.RazorCommentStar) @@ -72,7 +72,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .Accepts(AcceptedCharacters.None), Factory.Span(SpanKind.Comment, new CSharpSymbol( Factory.LocationTracker.CurrentLocation, - String.Empty, + string.Empty, CSharpSymbolType.Unknown)) .Accepts(AcceptedCharacters.Any), Factory.MetaCode("*", CSharpSymbolType.RazorCommentStar) @@ -103,7 +103,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .Accepts(AcceptedCharacters.None), Factory.Span(SpanKind.Comment, new CSharpSymbol( Factory.LocationTracker.CurrentLocation, - String.Empty, + string.Empty, CSharpSymbolType.Unknown)) .Accepts(AcceptedCharacters.Any)))), new RazorError(RazorResources.ParseError_RazorComment_Not_Terminated, 5, 0, 5), @@ -135,7 +135,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp .Accepts(AcceptedCharacters.None), Factory.Span(SpanKind.Comment, new HtmlSymbol( Factory.LocationTracker.CurrentLocation, - String.Empty, + string.Empty, HtmlSymbolType.Unknown)) .Accepts(AcceptedCharacters.Any), Factory.MetaMarkup("*", HtmlSymbolType.RazorCommentStar) @@ -165,7 +165,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp Factory.MetaCode("*", CSharpSymbolType.RazorCommentStar) .Accepts(AcceptedCharacters.None), Factory.Span(SpanKind.Comment, new CSharpSymbol(Factory.LocationTracker.CurrentLocation, - String.Empty, + string.Empty, CSharpSymbolType.Unknown)) .Accepts(AcceptedCharacters.Any)))), new RazorError(RazorResources.ParseError_RazorComment_Not_Terminated, 2, 0, 2), diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSectionTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSectionTest.cs index a6f60eb3c2..c8445c9e36 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSectionTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSectionTest.cs @@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp ParseDocumentTest("@section" + Environment.NewLine, new MarkupBlock( Factory.EmptyHtml(), - new SectionBlock(new SectionCodeGenerator(String.Empty), + new SectionBlock(new SectionCodeGenerator(string.Empty), Factory.CodeTransition(), Factory.MetaCode("section" + Environment.NewLine))), new RazorError( diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSpecialBlockTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSpecialBlockTest.cs index ef997b850e..5db86fad0b 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSpecialBlockTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/CSharp/CSharpSpecialBlockTest.cs @@ -42,7 +42,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp new DirectiveBlock( Factory.MetaCode("inherits ").Accepts(AcceptedCharacters.None), Factory.Code(" " + Environment.NewLine) - .AsBaseType(String.Empty) + .AsBaseType(string.Empty) ), new RazorError(RazorResources.ParseError_InheritsKeyword_Must_Be_Followed_By_TypeName, 24, 0, 24)); } @@ -103,7 +103,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp public void ParseBlockBalancesBracesOutsideStringsIfFirstCharacterIsBraceAndReturnsSpanOfTypeCode() { // Arrange - const string code = "foo\"b}ar\" if(condition) { String.Format(\"{0}\"); } "; + const string code = "foo\"b}ar\" if(condition) { string.Format(\"{0}\"); } "; // Act/Assert ParseBlockTest("{" + code + "}", @@ -118,7 +118,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp public void ParseBlockBalancesParensOutsideStringsIfFirstCharacterIsParenAndReturnsSpanOfTypeExpression() { // Arrange - const string code = "foo\"b)ar\" if(condition) { String.Format(\"{0}\"); } "; + const string code = "foo\"b)ar\" if(condition) { string.Format(\"{0}\"); } "; // Act/Assert ParseBlockTest("(" + code + ")", diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlBlockTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlBlockTest.cs index 236407ee77..7866b1c4db 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlBlockTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlBlockTest.cs @@ -215,16 +215,16 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("(" bar=\"", 4, 0, 4), new LocationTagged("\"", 13, 0, 13)), Factory.Markup(" bar=\"").With(SpanCodeGenerator.Null), - Factory.Markup("baz").With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 10, 0, 10), new LocationTagged("baz", 10, 0, 10))), + Factory.Markup("baz").With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 10, 0, 10), new LocationTagged("baz", 10, 0, 10))), Factory.Markup("\"").With(SpanCodeGenerator.Null)), Factory.Markup(">").Accepts(AcceptedCharacters.None)), new MarkupTagBlock( Factory.Markup("").Accepts(AcceptedCharacters.None)), new MarkupTagBlock( Factory.Markup("(" zoop=", 24, 0, 24), new LocationTagged(String.Empty, 34, 0, 34)), + new MarkupBlock(new AttributeBlockCodeGenerator("zoop", new LocationTagged(" zoop=", 24, 0, 24), new LocationTagged(string.Empty, 34, 0, 34)), Factory.Markup(" zoop=").With(SpanCodeGenerator.Null), - Factory.Markup("zork").With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 30, 0, 30), new LocationTagged("zork", 30, 0, 30)))), + Factory.Markup("zork").With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 30, 0, 30), new LocationTagged("zork", 30, 0, 30)))), Factory.Markup("/>").Accepts(AcceptedCharacters.None)), new MarkupTagBlock( Factory.Markup("").Accepts(AcceptedCharacters.None)), @@ -243,7 +243,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("(" baz=\"", 9, 0, 9), new LocationTagged("\"", 16, 0, 16)), Factory.Markup(" baz=\"").With(SpanCodeGenerator.Null), - Factory.Markup(">").With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 15, 0, 15), new LocationTagged(">", 15, 0, 15))), + Factory.Markup(">").With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 15, 0, 15), new LocationTagged(">", 15, 0, 15))), Factory.Markup("\"").With(SpanCodeGenerator.Null)), Factory.Markup(" />").Accepts(AcceptedCharacters.None)), new MarkupTagBlock( @@ -261,7 +261,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("(" baz='", 9, 0, 9), new LocationTagged("'", 16, 0, 16)), Factory.Markup(" baz='").With(SpanCodeGenerator.Null), - Factory.Markup(">").With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 15, 0, 15), new LocationTagged(">", 15, 0, 15))), + Factory.Markup(">").With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 15, 0, 15), new LocationTagged(">", 15, 0, 15))), Factory.Markup("'").With(SpanCodeGenerator.Null)), Factory.Markup(" />").Accepts(AcceptedCharacters.None)), new MarkupTagBlock( @@ -279,7 +279,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("(" baz=\"", 9, 0, 9), new LocationTagged("\"", 16, 0, 16)), Factory.Markup(" baz=\"").With(SpanCodeGenerator.Null), - Factory.Markup("/").With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 15, 0, 15), new LocationTagged("/", 15, 0, 15))), + Factory.Markup("/").With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 15, 0, 15), new LocationTagged("/", 15, 0, 15))), Factory.Markup("\"").With(SpanCodeGenerator.Null)), Factory.Markup(">").Accepts(AcceptedCharacters.None)), new MarkupTagBlock( @@ -299,7 +299,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("(" baz='", 9, 0, 9), new LocationTagged("'", 16, 0, 16)), Factory.Markup(" baz='").With(SpanCodeGenerator.Null), - Factory.Markup("/").With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 15, 0, 15), new LocationTagged("/", 15, 0, 15))), + Factory.Markup("/").With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 15, 0, 15), new LocationTagged("/", 15, 0, 15))), Factory.Markup("'").With(SpanCodeGenerator.Null)), Factory.Markup(">").Accepts(AcceptedCharacters.None)), new MarkupTagBlock( diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlDocumentTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlDocumentTest.cs index e460c63f17..355c6484ce 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlDocumentTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlDocumentTest.cs @@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html [Fact] public void ParseDocumentOutputsEmptyBlockWithEmptyMarkupSpanIfContentIsEmptyString() { - ParseDocumentTest(String.Empty, new MarkupBlock(Factory.EmptyHtml())); + ParseDocumentTest(string.Empty, new MarkupBlock(Factory.EmptyHtml())); } [Fact] @@ -176,7 +176,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html new MarkupBlock(new AttributeBlockCodeGenerator("href", new LocationTagged(" href=\"", 2, 0, 2), new LocationTagged("\"", 36, 0, 36)), Factory.Markup(" href=\"").With(SpanCodeGenerator.Null), Factory.Markup("mailto:anurse@microsoft.com") - .With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 9, 0, 9), new LocationTagged("mailto:anurse@microsoft.com", 9, 0, 9))), + .With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 9, 0, 9), new LocationTagged("mailto:anurse@microsoft.com", 9, 0, 9))), Factory.Markup("\"").With(SpanCodeGenerator.Null)), Factory.Markup(">")), Factory.Markup("Email me"), diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlErrorTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlErrorTest.cs index 147c342d1d..59a072948a 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlErrorTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlErrorTest.cs @@ -99,7 +99,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html new MarkupBlock( new MarkupTagBlock( Factory.Markup("(" bar=", 4, 0, 4), new LocationTagged(String.Empty, 12, 0, 12)), + new MarkupBlock(new AttributeBlockCodeGenerator("bar", new LocationTagged(" bar=", 4, 0, 4), new LocationTagged(string.Empty, 12, 0, 12)), Factory.Markup(" bar=").With(SpanCodeGenerator.Null), Factory.Markup("baz").With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 9, 0, 9), new LocationTagged("baz", 9, 0, 9)))))), new RazorError(RazorResources.FormatParseError_UnfinishedTag("foo"), new SourceLocation(0, 0, 0))); diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlToCodeSwitchTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlToCodeSwitchTest.cs index e594afb702..2fb604fe78 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlToCodeSwitchTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlToCodeSwitchTest.cs @@ -54,7 +54,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("(" bar=\"", 4, 0, 4), new LocationTagged("\"", 14, 0, 14)), Factory.Markup(" bar=\"").With(SpanCodeGenerator.Null), - new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(String.Empty, 10, 0, 10), 10, 0, 10), + new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(string.Empty, 10, 0, 10), 10, 0, 10), new ExpressionBlock( Factory.CodeTransition(), Factory.Code("baz") @@ -204,7 +204,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html new MarkupBlock(new AttributeBlockCodeGenerator("href", new LocationTagged(" href=\"", 2, 0, 2), new LocationTagged("\"", 36, 0, 36)), Factory.Markup(" href=\"").With(SpanCodeGenerator.Null), Factory.Markup("mailto:anurse@microsoft.com") - .With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 9, 0, 9), new LocationTagged("mailto:anurse@microsoft.com", 9, 0, 9))), + .With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 9, 0, 9), new LocationTagged("mailto:anurse@microsoft.com", 9, 0, 9))), Factory.Markup("\"").With(SpanCodeGenerator.Null)), Factory.Markup(">").Accepts(AcceptedCharacters.None)), Factory.Markup("Email me"), diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlUrlAttributeTest.cs b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlUrlAttributeTest.cs index ddd542e165..1092a91dc1 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlUrlAttributeTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlUrlAttributeTest.cs @@ -26,7 +26,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("~/Foo/Bar/Baz") .WithEditorHints(EditorHints.VirtualPath) .With(new LiteralAttributeCodeGenerator( - new LocationTagged(String.Empty, 9, 0, 9), + new LocationTagged(string.Empty, 9, 0, 9), new LocationTagged(new ResolveUrlCodeGenerator(), 9, 0, 9))), Factory.Markup("'").With(SpanCodeGenerator.Null)), Factory.Markup(" />").Accepts(AcceptedCharacters.None)))); @@ -44,7 +44,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("~/Foo/Bar/Baz") .WithEditorHints(EditorHints.VirtualPath) .With(new LiteralAttributeCodeGenerator( - new LocationTagged(String.Empty, 9, 0, 9), + new LocationTagged(string.Empty, 9, 0, 9), new LocationTagged(new ResolveUrlCodeGenerator(), 9, 0, 9))), Factory.Markup("'").With(SpanCodeGenerator.Null)), Factory.Markup(" />")))); @@ -70,7 +70,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("~/Foo/Bar/Baz") .WithEditorHints(EditorHints.VirtualPath) .With(new LiteralAttributeCodeGenerator( - new LocationTagged(String.Empty, 24, 0, 24), + new LocationTagged(string.Empty, 24, 0, 24), new LocationTagged(new ResolveUrlCodeGenerator(), 24, 0, 24))), Factory.Markup("'").With(SpanCodeGenerator.Null)), Factory.Markup(" />")), @@ -92,16 +92,16 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("~/Foo/") .WithEditorHints(EditorHints.VirtualPath) .With(new LiteralAttributeCodeGenerator( - new LocationTagged(String.Empty, 9, 0, 9), + new LocationTagged(string.Empty, 9, 0, 9), new LocationTagged(new ResolveUrlCodeGenerator(), 9, 0, 9))), - new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(String.Empty, 15, 0, 15), 15, 0, 15), + new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(string.Empty, 15, 0, 15), 15, 0, 15), new ExpressionBlock( Factory.CodeTransition().Accepts(AcceptedCharacters.None), Factory.Code("id") .AsImplicitExpression(CSharpCodeParser.DefaultKeywords) .Accepts(AcceptedCharacters.NonWhiteSpace))), Factory.Markup("/Baz") - .With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 18, 0, 18), new LocationTagged("/Baz", 18, 0, 18))), + .With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 18, 0, 18), new LocationTagged("/Baz", 18, 0, 18))), Factory.Markup("'").With(SpanCodeGenerator.Null)), Factory.Markup(" />").Accepts(AcceptedCharacters.None)))); } @@ -118,16 +118,16 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("~/Foo/") .WithEditorHints(EditorHints.VirtualPath) .With(new LiteralAttributeCodeGenerator( - new LocationTagged(String.Empty, 9, 0, 9), + new LocationTagged(string.Empty, 9, 0, 9), new LocationTagged(new ResolveUrlCodeGenerator(), 9, 0, 9))), - new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(String.Empty, 15, 0, 15), 15, 0, 15), + new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(string.Empty, 15, 0, 15), 15, 0, 15), new ExpressionBlock( Factory.CodeTransition().Accepts(AcceptedCharacters.None), Factory.Code("id") .AsImplicitExpression(CSharpCodeParser.DefaultKeywords) .Accepts(AcceptedCharacters.NonWhiteSpace))), Factory.Markup("/Baz") - .With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 18, 0, 18), new LocationTagged("/Baz", 18, 0, 18))), + .With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 18, 0, 18), new LocationTagged("/Baz", 18, 0, 18))), Factory.Markup("'").With(SpanCodeGenerator.Null)), Factory.Markup(" />")))); } @@ -151,16 +151,16 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("~/Foo/") .WithEditorHints(EditorHints.VirtualPath) .With(new LiteralAttributeCodeGenerator( - new LocationTagged(String.Empty, 24, 0, 24), + new LocationTagged(string.Empty, 24, 0, 24), new LocationTagged(new ResolveUrlCodeGenerator(), 24, 0, 24))), - new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(String.Empty, 30, 0, 30), 30, 0, 30), + new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(string.Empty, 30, 0, 30), 30, 0, 30), new ExpressionBlock( Factory.CodeTransition().Accepts(AcceptedCharacters.None), Factory.Code("id") .AsImplicitExpression(CSharpCodeParser.DefaultKeywords) .Accepts(AcceptedCharacters.NonWhiteSpace))), Factory.Markup("/Baz") - .With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 33, 0, 33), new LocationTagged("/Baz", 33, 0, 33))), + .With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 33, 0, 33), new LocationTagged("/Baz", 33, 0, 33))), Factory.Markup("'").With(SpanCodeGenerator.Null)), Factory.Markup(" />")), Factory.Markup(" ") @@ -181,7 +181,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("~/Foo+Bar:Baz(Biz),Boz") .WithEditorHints(EditorHints.VirtualPath) .With(new LiteralAttributeCodeGenerator( - new LocationTagged(String.Empty, 9, 0, 9), + new LocationTagged(string.Empty, 9, 0, 9), new LocationTagged(new ResolveUrlCodeGenerator(), 9, 0, 9))), Factory.Markup("'").With(SpanCodeGenerator.Null)), Factory.Markup(" />").Accepts(AcceptedCharacters.None)))); @@ -199,7 +199,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup("~/Foo+Bar:Baz(Biz),Boz") .WithEditorHints(EditorHints.VirtualPath) .With(new LiteralAttributeCodeGenerator( - new LocationTagged(String.Empty, 9, 0, 9), + new LocationTagged(string.Empty, 9, 0, 9), new LocationTagged(new ResolveUrlCodeGenerator(), 9, 0, 9))), Factory.Markup("'").With(SpanCodeGenerator.Null)), Factory.Markup(" />")))); @@ -212,21 +212,21 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html new MarkupBlock( new MarkupTagBlock( Factory.Markup("(" href=", 2, 0, 2), new LocationTagged(String.Empty, 38, 0, 38)), + new MarkupBlock(new AttributeBlockCodeGenerator("href", new LocationTagged(" href=", 2, 0, 2), new LocationTagged(string.Empty, 38, 0, 38)), Factory.Markup(" href=").With(SpanCodeGenerator.Null), Factory.Markup("~/Foo+Bar:Baz(Biz),Boz/") .WithEditorHints(EditorHints.VirtualPath) .With(new LiteralAttributeCodeGenerator( - new LocationTagged(String.Empty, 8, 0, 8), + new LocationTagged(string.Empty, 8, 0, 8), new LocationTagged(new ResolveUrlCodeGenerator(), 8, 0, 8))), - new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(String.Empty, 31, 0, 31), 31, 0, 31), + new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(string.Empty, 31, 0, 31), 31, 0, 31), new ExpressionBlock( Factory.CodeTransition() .Accepts(AcceptedCharacters.None), Factory.Code("id") .AsImplicitExpression(CSharpCodeParser.DefaultKeywords) .Accepts(AcceptedCharacters.NonWhiteSpace))), - Factory.Markup("/Boz").With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 34, 0, 34), new LocationTagged("/Boz", 34, 0, 34)))), + Factory.Markup("/Boz").With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 34, 0, 34), new LocationTagged("/Boz", 34, 0, 34)))), Factory.Markup(" />").Accepts(AcceptedCharacters.None)))); } @@ -237,21 +237,21 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html new MarkupBlock( new MarkupTagBlock( Factory.Markup("(" href=", 2, 0, 2), new LocationTagged(String.Empty, 38, 0, 38)), + new MarkupBlock(new AttributeBlockCodeGenerator("href", new LocationTagged(" href=", 2, 0, 2), new LocationTagged(string.Empty, 38, 0, 38)), Factory.Markup(" href=").With(SpanCodeGenerator.Null), Factory.Markup("~/Foo+Bar:Baz(Biz),Boz/") .WithEditorHints(EditorHints.VirtualPath) .With(new LiteralAttributeCodeGenerator( - new LocationTagged(String.Empty, 8, 0, 8), + new LocationTagged(string.Empty, 8, 0, 8), new LocationTagged(new ResolveUrlCodeGenerator(), 8, 0, 8))), - new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(String.Empty, 31, 0, 31), 31, 0, 31), + new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(string.Empty, 31, 0, 31), 31, 0, 31), new ExpressionBlock( Factory.CodeTransition() .Accepts(AcceptedCharacters.None), Factory.Code("id") .AsImplicitExpression(CSharpCodeParser.DefaultKeywords) .Accepts(AcceptedCharacters.NonWhiteSpace))), - Factory.Markup("/Boz").With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 34, 0, 34), new LocationTagged("/Boz", 34, 0, 34)))), + Factory.Markup("/Boz").With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 34, 0, 34), new LocationTagged("/Boz", 34, 0, 34)))), Factory.Markup(" />")))); } @@ -269,21 +269,21 @@ namespace Microsoft.AspNet.Razor.Test.Parser.Html Factory.Markup(" "), new MarkupTagBlock( Factory.Markup("(" href=", 17, 0, 17), new LocationTagged(String.Empty, 53, 0, 53)), + new MarkupBlock(new AttributeBlockCodeGenerator("href", new LocationTagged(" href=", 17, 0, 17), new LocationTagged(string.Empty, 53, 0, 53)), Factory.Markup(" href=").With(SpanCodeGenerator.Null), Factory.Markup("~/Foo+Bar:Baz(Biz),Boz/") .WithEditorHints(EditorHints.VirtualPath) .With(new LiteralAttributeCodeGenerator( - new LocationTagged(String.Empty, 23, 0, 23), + new LocationTagged(string.Empty, 23, 0, 23), new LocationTagged(new ResolveUrlCodeGenerator(), 23, 0, 23))), - new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(String.Empty, 46, 0, 46), 46, 0, 46), + new MarkupBlock(new DynamicAttributeBlockCodeGenerator(new LocationTagged(string.Empty, 46, 0, 46), 46, 0, 46), new ExpressionBlock( Factory.CodeTransition() .Accepts(AcceptedCharacters.None), Factory.Code("id") .AsImplicitExpression(CSharpCodeParser.DefaultKeywords) .Accepts(AcceptedCharacters.NonWhiteSpace))), - Factory.Markup("/Boz").With(new LiteralAttributeCodeGenerator(new LocationTagged(String.Empty, 49, 0, 49), new LocationTagged("/Boz", 49, 0, 49)))), + Factory.Markup("/Boz").With(new LiteralAttributeCodeGenerator(new LocationTagged(string.Empty, 49, 0, 49), new LocationTagged("/Boz", 49, 0, 49)))), Factory.Markup(" />")), Factory.Markup(" ") ), diff --git a/test/Microsoft.AspNet.Razor.Test/Parser/PartialParsing/PartialParsingTestBase.cs b/test/Microsoft.AspNet.Razor.Test/Parser/PartialParsing/PartialParsingTestBase.cs index d4d89c1b3f..74562100a4 100644 --- a/test/Microsoft.AspNet.Razor.Test/Parser/PartialParsing/PartialParsingTestBase.cs +++ b/test/Microsoft.AspNet.Razor.Test/Parser/PartialParsing/PartialParsingTestBase.cs @@ -105,7 +105,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.PartialParsing public void InitializeWithDocument(ITextBuffer startDocument) { - CheckForStructureChangesAndWait(new TextChange(0, 0, new StringTextBuffer(String.Empty), startDocument.Length, startDocument)); + CheckForStructureChangesAndWait(new TextChange(0, 0, new StringTextBuffer(string.Empty), startDocument.Length, startDocument)); } public PartialParseResult CheckForStructureChangesAndWait(TextChange change) diff --git a/test/Microsoft.AspNet.Razor.Test/Text/TextChangeTest.cs b/test/Microsoft.AspNet.Razor.Test/Text/TextChangeTest.cs index 05aaae0569..18186f49e9 100644 --- a/test/Microsoft.AspNet.Razor.Test/Text/TextChangeTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/Text/TextChangeTest.cs @@ -222,7 +222,7 @@ namespace Microsoft.AspNet.Razor.Test.Text var text = textChange.NewText; // Assert - Assert.Equal(String.Empty, text); + Assert.Equal(string.Empty, text); } [Fact] diff --git a/test/Microsoft.AspNet.Razor.Test/Tokenizer/CSharpTokenizerTestBase.cs b/test/Microsoft.AspNet.Razor.Test/Tokenizer/CSharpTokenizerTestBase.cs index 56ef769112..ddaa48b477 100644 --- a/test/Microsoft.AspNet.Razor.Test/Tokenizer/CSharpTokenizerTestBase.cs +++ b/test/Microsoft.AspNet.Razor.Test/Tokenizer/CSharpTokenizerTestBase.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Razor.Test.Tokenizer { public abstract class CSharpTokenizerTestBase : TokenizerTestBase { - private static CSharpSymbol _ignoreRemaining = new CSharpSymbol(0, 0, 0, String.Empty, CSharpSymbolType.Unknown); + private static CSharpSymbol _ignoreRemaining = new CSharpSymbol(0, 0, 0, string.Empty, CSharpSymbolType.Unknown); protected override CSharpSymbol IgnoreRemaining { diff --git a/test/Microsoft.AspNet.Razor.Test/Tokenizer/HtmlTokenizerTestBase.cs b/test/Microsoft.AspNet.Razor.Test/Tokenizer/HtmlTokenizerTestBase.cs index 9c0aac1ad7..16b1d5b0f9 100644 --- a/test/Microsoft.AspNet.Razor.Test/Tokenizer/HtmlTokenizerTestBase.cs +++ b/test/Microsoft.AspNet.Razor.Test/Tokenizer/HtmlTokenizerTestBase.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Razor.Test.Tokenizer { public abstract class HtmlTokenizerTestBase : TokenizerTestBase { - private static HtmlSymbol _ignoreRemaining = new HtmlSymbol(0, 0, 0, String.Empty, HtmlSymbolType.Unknown); + private static HtmlSymbol _ignoreRemaining = new HtmlSymbol(0, 0, 0, string.Empty, HtmlSymbolType.Unknown); protected override HtmlSymbol IgnoreRemaining { diff --git a/test/Microsoft.AspNet.Razor.Test/Tokenizer/TokenizerTestBase.cs b/test/Microsoft.AspNet.Razor.Test/Tokenizer/TokenizerTestBase.cs index 8cdd4a2557..b39334bdf7 100644 --- a/test/Microsoft.AspNet.Razor.Test/Tokenizer/TokenizerTestBase.cs +++ b/test/Microsoft.AspNet.Razor.Test/Tokenizer/TokenizerTestBase.cs @@ -34,23 +34,23 @@ namespace Microsoft.AspNet.Razor.Test.Tokenizer { if (counter >= expectedSymbols.Length) { - output.AppendLine(String.Format("F: Expected: << Nothing >>; Actual: {0}", current)); + output.AppendLine(string.Format("F: Expected: << Nothing >>; Actual: {0}", current)); success = false; } else if (ReferenceEquals(expectedSymbols[counter], IgnoreRemaining)) { - output.AppendLine(String.Format("P: Ignored {0}", current)); + output.AppendLine(string.Format("P: Ignored {0}", current)); } else { if (!Equals(expectedSymbols[counter], current)) { - output.AppendLine(String.Format("F: Expected: {0}; Actual: {1}", expectedSymbols[counter], current)); + output.AppendLine(string.Format("F: Expected: {0}; Actual: {1}", expectedSymbols[counter], current)); success = false; } else { - output.AppendLine(String.Format("P: Expected: {0}", expectedSymbols[counter])); + output.AppendLine(string.Format("P: Expected: {0}", expectedSymbols[counter])); } counter++; } @@ -60,7 +60,7 @@ namespace Microsoft.AspNet.Razor.Test.Tokenizer success = false; for (; counter < expectedSymbols.Length; counter++) { - output.AppendLine(String.Format("F: Expected: {0}; Actual: << None >>", expectedSymbols[counter])); + output.AppendLine(string.Format("F: Expected: {0}; Actual: << None >>", expectedSymbols[counter])); } } } @@ -72,7 +72,7 @@ namespace Microsoft.AspNet.Razor.Test.Tokenizer [Conditional("PARSER_TRACE")] private static void WriteTraceLine(string format, params object[] args) { - Trace.WriteLine(String.Format(format, args)); + Trace.WriteLine(string.Format(format, args)); } } }