- For tests added grouped pragma warning disables to not pollute the test files with too many duplicate warning disable/restores.

#780
This commit is contained in:
N. Taylor Mullen 2016-07-29 16:29:33 -07:00
Родитель d337bacc69
Коммит fc4a61586e
6 изменённых файлов: 18 добавлений и 3 удалений

Просмотреть файл

@ -6,9 +6,10 @@ using System;
namespace Microsoft.AspNetCore.Razor.Editor namespace Microsoft.AspNetCore.Razor.Editor
{ {
/// <summary> /// <summary>
/// Used within <see cref="F:SpanEditHandler.EditorHints"/>. /// This class is obsolete and will be removed in a future version.
/// </summary> /// </summary>
[Flags] [Flags]
[Obsolete("This class is obsolete and will be removed in a future version.")]
public enum EditorHints public enum EditorHints
{ {
/// <summary> /// <summary>

Просмотреть файл

@ -29,8 +29,9 @@ namespace Microsoft.AspNetCore.Razor.Editor
public AcceptedCharacters AcceptedCharacters { get; set; } public AcceptedCharacters AcceptedCharacters { get; set; }
/// <summary> /// <summary>
/// Provides a set of hints to editors which may be manipulating the document in which this span is located. /// This property is obsolete and will be removed in a future version.
/// </summary> /// </summary>
[Obsolete("This property is obsolete and will be removed in a future version.")]
public EditorHints EditorHints { get; set; } public EditorHints EditorHints { get; set; }
public Func<string, IEnumerable<ISymbol>> Tokenizer { get; set; } public Func<string, IEnumerable<ISymbol>> Tokenizer { get; set; }
@ -158,7 +159,10 @@ namespace Microsoft.AspNetCore.Razor.Editor
public override string ToString() public override string ToString()
{ {
return GetType().Name + ";Accepts:" + AcceptedCharacters + ((EditorHints == EditorHints.None) ? string.Empty : (";Hints: " + EditorHints.ToString())); return GetType().Name + ";Accepts:" + AcceptedCharacters +
#pragma warning disable 618 // Ignore obsolete warning for EditorHints
((EditorHints == EditorHints.None) ? string.Empty : (";Hints: " + EditorHints.ToString()));
#pragma warning restore 618 // Ignore obsolete warning for EditorHints
} }
public override bool Equals(object obj) public override bool Equals(object obj)
@ -167,7 +171,9 @@ namespace Microsoft.AspNetCore.Razor.Editor
return other != null && return other != null &&
GetType() == other.GetType() && GetType() == other.GetType() &&
AcceptedCharacters == other.AcceptedCharacters && AcceptedCharacters == other.AcceptedCharacters &&
#pragma warning disable 618 // Ignore obsolete warning for EditorHints
EditorHints == other.EditorHints; EditorHints == other.EditorHints;
#pragma warning restore 618 // Ignore obsolete warning for EditorHints
} }
public override int GetHashCode() public override int GetHashCode()

Просмотреть файл

@ -10,6 +10,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
{ {
public class AutoCompleteEditHandlerTest public class AutoCompleteEditHandlerTest
{ {
#pragma warning disable 618 // Ignore obsolete warning for EditorHints
public static TheoryData<AutoCompleteEditHandler, AutoCompleteEditHandler> MatchingTestDataSet public static TheoryData<AutoCompleteEditHandler, AutoCompleteEditHandler> MatchingTestDataSet
{ {
get get
@ -180,6 +181,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
}; };
} }
} }
#pragma warning restore 618 // Ignore obsolete warning for EditorHints
[Theory] [Theory]
[MemberData(nameof(MatchingTestDataSet))] [MemberData(nameof(MatchingTestDataSet))]

Просмотреть файл

@ -12,6 +12,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
{ {
public class ImplicitExpressionEditHandlerTest public class ImplicitExpressionEditHandlerTest
{ {
#pragma warning disable 618 // Ignore obsolete warning for EditorHints
public static TheoryData<ImplicitExpressionEditHandler, ImplicitExpressionEditHandler> MatchingTestDataSet public static TheoryData<ImplicitExpressionEditHandler, ImplicitExpressionEditHandler> MatchingTestDataSet
{ {
get get
@ -253,6 +254,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
}; };
} }
} }
#pragma warning restore 618 // Ignore obsolete warning for EditorHints
[Theory] [Theory]
[MemberData(nameof(MatchingTestDataSet))] [MemberData(nameof(MatchingTestDataSet))]

Просмотреть файл

@ -11,6 +11,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
{ {
public class SpanEditHandlerTest public class SpanEditHandlerTest
{ {
#pragma warning disable 618 // Ignore obsolete warning for EditorHints
public static TheoryData<SpanEditHandler, SpanEditHandler> MatchingTestDataSet public static TheoryData<SpanEditHandler, SpanEditHandler> MatchingTestDataSet
{ {
get get
@ -127,6 +128,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
}; };
} }
} }
#pragma warning restore 618 // Ignore obsolete warning for EditorHints
[Theory] [Theory]
[MemberData(nameof(MatchingTestDataSet))] [MemberData(nameof(MatchingTestDataSet))]

Просмотреть файл

@ -269,10 +269,12 @@ namespace Microsoft.AspNetCore.Razor.Test.Framework
}); });
} }
#pragma warning disable 618 // Ignore obsolete warning for EditorHints
public static SpanConstructor WithEditorHints(this SpanConstructor self, EditorHints hints) public static SpanConstructor WithEditorHints(this SpanConstructor self, EditorHints hints)
{ {
return self.With(eh => eh.EditorHints = hints); return self.With(eh => eh.EditorHints = hints);
} }
#pragma warning restore 618 // Ignore obsolete warning for EditorHints
} }
public class UnclassifiedCodeSpanConstructor public class UnclassifiedCodeSpanConstructor