Fix tests failing xunit analyzers after dependency update (#47954)
authorStephen Toub <stoub@microsoft.com>
Sat, 6 Feb 2021 16:23:13 +0000 (11:23 -0500)
committerGitHub <noreply@github.com>
Sat, 6 Feb 2021 16:23:13 +0000 (11:23 -0500)
src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs
src/libraries/System.Text.Json/tests/Serialization/CollectionTests/CollectionTests.Generic.Read.cs
src/libraries/System.Text.Json/tests/Serialization/ContinuationTests.cs
src/libraries/System.Text.Json/tests/Serialization/InvalidTypeTests.cs
src/libraries/System.Text.Json/tests/Serialization/NumberHandlingTests.cs
src/libraries/System.Text.Json/tests/Serialization/PropertyVisibilityTests.cs

index 0335ec1..fdca190 100644 (file)
@@ -2628,7 +2628,7 @@ namespace System.Net.Http.Functional.Tests
     {
         public SocketsHttpHandlerTest_PlaintextStreamFilter(ITestOutputHelper output) : base(output) { }
 
-        public static IEnumerable<object> PlaintextStreamFilter_ContextHasCorrectProperties_Success_MemberData() =>
+        public static IEnumerable<object[]> PlaintextStreamFilter_ContextHasCorrectProperties_Success_MemberData() =>
             from useSsl in new[] { false, true }
             from syncRequest in new[] { false, true }
             from syncCallback in new[] { false, true }
index e2758f8..d9d3227 100644 (file)
@@ -1264,14 +1264,14 @@ namespace System.Text.Json.Serialization.Tests
             Assert.Contains(type.ToString(), ex.ToString());
         }
 
-        private static IEnumerable<object[]> CustomInterfaces_Enumerables()
+        public static IEnumerable<object[]> CustomInterfaces_Enumerables()
         {
             yield return new object[] { typeof(IDerivedICollectionOfT<string>) };
             yield return new object[] { typeof(IDerivedIList) };
             yield return new object[] { typeof(IDerivedISetOfT<string>) };
         }
 
-        private static IEnumerable<object[]> CustomInterfaces_Dictionaries()
+        public static IEnumerable<object[]> CustomInterfaces_Dictionaries()
         {
             yield return new object[] { typeof(IDerivedIDictionaryOfTKeyTValue<string, string>) };
         }
index a2548b0..59c40b6 100644 (file)
@@ -38,7 +38,7 @@ namespace System.Text.Json.Serialization.Tests
         private static IEnumerable<bool> WriteIndented
             => new[] { true, false };
 
-        private static IEnumerable<object[]> TestData(bool enumeratePayloadTweaks)
+        public static IEnumerable<object[]> TestData(bool enumeratePayloadTweaks)
         {
             // The serialized json gets padded with leading ' ' chars. The length of the
             // incrementing paddings, leads to continuations at every position of the payload.
index 60c2a84..6a39e9d 100644 (file)
@@ -112,7 +112,7 @@ namespace System.Text.Json.Serialization.Tests
 
         private class Test<T> { }
 
-        private static IEnumerable<object[]> OpenGenericTypes()
+        public static IEnumerable<object[]> OpenGenericTypes()
         {
             yield return new object[] { typeof(Test<>) };
             yield return new object[] { typeof(Nullable<>) };
@@ -125,14 +125,14 @@ namespace System.Text.Json.Serialization.Tests
             yield return new object[] { typeof(Dictionary<,>).MakeGenericType(typeof(Nullable<>), typeof(string)) };
         }
 
-        private static IEnumerable<object[]> OpenGenericTypes_ToSerialize()
+        public static IEnumerable<object[]> OpenGenericTypes_ToSerialize()
         {
             yield return new object[] { typeof(Test<>) };
             yield return new object[] { typeof(List<>) };
             yield return new object[] { typeof(Dictionary<,>) };
         }
 
-        private static IEnumerable<object[]> RefStructTypes()
+        public static IEnumerable<object[]> RefStructTypes()
         {
             yield return new object[] { typeof(Span<int>) };
             yield return new object[] { typeof(Utf8JsonReader) };
@@ -141,7 +141,7 @@ namespace System.Text.Json.Serialization.Tests
 
         private static readonly Type s_intPtrType = typeof(int*); // Unsafe code may not appear in iterators.
 
-        private static IEnumerable<object[]> PointerTypes()
+        public static IEnumerable<object[]> PointerTypes()
         {
             yield return new object[] { s_intPtrType };
         }
@@ -150,7 +150,7 @@ namespace System.Text.Json.Serialization.Tests
         // to the serializer on serialization due to type constraints,
         // e.g. int* can't be boxed and passed to the non-generic overload,
         // and typeof(int*) can't be a generic parameter to the generic overload.
-        private static IEnumerable<object[]> TypesWithInvalidMembers_WithMembers()
+        public static IEnumerable<object[]> TypesWithInvalidMembers_WithMembers()
         {
             yield return new object[] { typeof(Memory<byte>), typeof(Span<byte>), "Span" }; // Contains Span<byte> property.
 
index 0fff01a..83440a1 100644 (file)
@@ -1657,7 +1657,7 @@ namespace System.Text.Json.Serialization.Tests
             JsonTestHelper.AssertJsonEqual(json, JsonSerializer.Serialize(result, options));
         }
 
-        private static IEnumerable<object[]> NumberHandling_ForPropsReadAfter_DeserializingCtorParams_TestData()
+        public static IEnumerable<object[]> NumberHandling_ForPropsReadAfter_DeserializingCtorParams_TestData()
         {
             yield return new object[]
             {
index 539ef0d..ede7f8a 100644 (file)
@@ -1593,7 +1593,7 @@ namespace System.Text.Json.Serialization.Tests
             }
         }
 
-        private static IEnumerable<object[]> JsonIgnoreConditionWhenWritingDefault_ClassProperty_TestData()
+        public static IEnumerable<object[]> JsonIgnoreConditionWhenWritingDefault_ClassProperty_TestData()
         {
             yield return new object[] { typeof(ClassWithClassProperty_IgnoreConditionWhenWritingDefault), new JsonSerializerOptions() };
             yield return new object[] { typeof(ClassWithClassProperty_IgnoreConditionWhenWritingDefault_Ctor), new JsonSerializerOptions { IgnoreNullValues = true } };
@@ -1645,7 +1645,7 @@ namespace System.Text.Json.Serialization.Tests
             }
         }
 
-        private static IEnumerable<object[]> JsonIgnoreConditionWhenWritingDefault_StructProperty_TestData()
+        public static IEnumerable<object[]> JsonIgnoreConditionWhenWritingDefault_StructProperty_TestData()
         {
             yield return new object[] { typeof(ClassWithStructProperty_IgnoreConditionWhenWritingDefault), new JsonSerializerOptions() };
             yield return new object[] { typeof(StructWithStructProperty_IgnoreConditionWhenWritingDefault_Ctor), new JsonSerializerOptions { IgnoreNullValues = true } };
@@ -1735,7 +1735,7 @@ namespace System.Text.Json.Serialization.Tests
             }
         }
 
-        private static IEnumerable<object[]> JsonIgnoreConditionNever_TestData()
+        public static IEnumerable<object[]> JsonIgnoreConditionNever_TestData()
         {
             yield return new object[] { typeof(ClassWithStructProperty_IgnoreConditionNever) };
             yield return new object[] { typeof(ClassWithStructProperty_IgnoreConditionNever_Ctor) };