Skip to content

Commit 24835e4

Browse files
sebastienrosjaviercn
authored andcommitted
Fix more errors
1 parent 33e3a90 commit 24835e4

File tree

12 files changed

+24
-26
lines changed

12 files changed

+24
-26
lines changed

src/DataProtection/DataProtection/test/Microsoft.AspNetCore.DataProtection.Tests/Cng/CbcAuthenticatedEncryptorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void Encrypt_Decrypt_RoundTrips()
2929
byte[] decipheredtext = encryptor.Decrypt(new ArraySegment<byte>(ciphertext), aad);
3030

3131
// Assert
32-
Assert.Equal(plaintext.AsSpan(), decipheredtext);
32+
Assert.Equal(plaintext.AsSpan(), decipheredtext.AsSpan());
3333
}
3434

3535
[ConditionalFact]

src/DataProtection/DataProtection/test/Microsoft.AspNetCore.DataProtection.Tests/Cng/GcmAuthenticatedEncryptorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void Encrypt_Decrypt_RoundTrips()
2626
byte[] decipheredtext = encryptor.Decrypt(new ArraySegment<byte>(ciphertext), aad);
2727

2828
// Assert
29-
Assert.Equal(plaintext.AsSpan(), decipheredtext);
29+
Assert.Equal(plaintext.AsSpan(), decipheredtext.AsSpan());
3030
}
3131

3232
[ConditionalFact]

src/DataProtection/DataProtection/test/Microsoft.AspNetCore.DataProtection.Tests/Managed/ManagedAuthenticatedEncryptorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void Encrypt_Decrypt_RoundTrips()
2525
byte[] decipheredtext = encryptor.Decrypt(new ArraySegment<byte>(ciphertext), aad);
2626

2727
// Assert
28-
Assert.Equal(plaintext.AsSpan(), decipheredtext);
28+
Assert.Equal(plaintext.AsSpan(), decipheredtext.AsSpan());
2929
}
3030

3131
[Fact]

src/Middleware/HeaderPropagation/test/HeaderPropagationMiddlewareTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public async Task HeaderInRequest_AddCorrectValue()
4444

4545
// Assert
4646
Assert.Contains("in", CapturedHeaders.Keys);
47-
Assert.Equal(new[] { "test" }, CapturedHeaders["in"]);
47+
Assert.Equal(new[] { "test" }, CapturedHeaders["in"].ToArray());
4848
}
4949

5050
[Fact]
@@ -87,9 +87,9 @@ public async Task MultipleHeadersInRequest_AddAllHeaders()
8787

8888
// Assert
8989
Assert.Contains("in", CapturedHeaders.Keys);
90-
Assert.Equal(new[] { "test" }, CapturedHeaders["in"]);
90+
Assert.Equal(new[] { "test" }, CapturedHeaders["in"].ToArray());
9191
Assert.Contains("another", CapturedHeaders.Keys);
92-
Assert.Equal(new[] { "test2" }, CapturedHeaders["another"]);
92+
Assert.Equal(new[] { "test2" }, CapturedHeaders["another"].ToArray());
9393
}
9494

9595
[Theory]
@@ -132,7 +132,7 @@ public async Task UsesValueFilter(string[] filterValues, string[] expectedValues
132132

133133
// Assert
134134
Assert.Contains("in", CapturedHeaders.Keys);
135-
Assert.Equal(expectedValues, CapturedHeaders["in"]);
135+
Assert.Equal(expectedValues, CapturedHeaders["in"].ToArray());
136136
Assert.Equal("in", receivedName);
137137
Assert.Equal(new StringValues("value"), receivedValue);
138138
Assert.Same(Context, receivedContext);

src/Middleware/OutputCaching/test/OutputCachePoliciesTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public async Task VaryByHeadersPolicy_AddsMultipleHeaders()
214214

215215
await policy.CacheRequestAsync(context, default);
216216

217-
Assert.Equal(headers, context.CacheVaryByRules.HeaderNames);
217+
Assert.Equal(headers, context.CacheVaryByRules.HeaderNames.ToArray());
218218
}
219219

220220
[Fact]
@@ -252,7 +252,7 @@ public async Task VaryByQueryPolicy_AddsMultipleHeaders()
252252

253253
await policy.CacheRequestAsync(context, default);
254254

255-
Assert.Equal(queries, context.CacheVaryByRules.QueryKeys);
255+
Assert.Equal(queries, context.CacheVaryByRules.QueryKeys.ToArray());
256256
}
257257

258258
[Fact]
@@ -265,7 +265,7 @@ public async Task VaryByQueryPolicy_AddsMultipleHeadersArray()
265265

266266
await policy.CacheRequestAsync(context, default);
267267

268-
Assert.Equal(queries, context.CacheVaryByRules.QueryKeys);
268+
Assert.Equal(queries, context.CacheVaryByRules.QueryKeys.ToArray());
269269
}
270270

271271
[Fact]

src/Mvc/Mvc.Abstractions/test/ModelBinding/ValueProviderResultTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void Construct_With_Array()
7676

7777
// Assert
7878
Assert.Equal(2, result.Length);
79-
Assert.Equal(new string[] { "Hi", "There" }, result.Values);
79+
Assert.Equal(new string[] { "Hi", "There" }, result.Values.ToArray());
8080
Assert.Equal("Hi", result.FirstValue);
8181
Assert.NotEqual(ValueProviderResult.None, result);
8282
Assert.Equal("Hi,There", (string)result);

src/Mvc/Mvc.Core/test/ModelBinding/EnumerableValueProviderTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public void GetValue_MultiValue()
179179
var result = valueProvider.GetValue("some");
180180

181181
// Assert
182-
Assert.Equal(new[] { "someValue1", "someValue2" }, result.Values);
182+
Assert.Equal(new[] { "someValue1", "someValue2" }, result.Values.ToArray());
183183
Assert.Equal("someValue1,someValue2", (string)result);
184184
Assert.Equal(culture, result.Culture);
185185
}
@@ -215,7 +215,7 @@ public void GetValue_NullMultipleValue()
215215
var result = valueProvider.GetValue("key");
216216

217217
// Assert
218-
Assert.Equal(new[] { null, null, "value" }, result.Values);
218+
Assert.Equal(new[] { null, null, "value" }, result.Values.ToArray());
219219
}
220220

221221
[Fact]

src/Mvc/Mvc.ViewFeatures/test/Rendering/HtmlHelperPasswordTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public static TheoryData<ViewDataDictionary<PasswordModel>, object> PasswordWith
4444
var data = new TheoryData<ViewDataDictionary<PasswordModel>, object>();
4545
foreach (var items in HtmlAttributeData)
4646
{
47-
data.Add(viewData, items[0]);
48-
data.Add(nullModelViewData, items[0]);
47+
data.Add(viewData, items.ToArray());
48+
data.Add(nullModelViewData, items.ToArray());
4949
}
5050

5151
return data;

src/Razor/Razor.Runtime/test/Runtime/TagHelpers/TagHelperExecutionContextTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,8 @@ public static TheoryData<HtmlEncoder> HtmlEncoderDataLessNull
245245
get
246246
{
247247
var data = new TheoryData<HtmlEncoder>();
248-
foreach (var row in HtmlEncoderData)
248+
foreach (var encoder in HtmlEncoderData)
249249
{
250-
var encoder = (HtmlEncoder)(row[0]);
251250
if (encoder != null)
252251
{
253252
data.Add(encoder);

src/Razor/Razor/test/TagHelpers/TagHelperOutputTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,8 @@ public static TheoryData<bool, HtmlEncoder> UseCachedResultAndHtmlEncoderData
164164
var data = new TheoryData<bool, HtmlEncoder>();
165165
foreach (var useCachedResult in new[] { false, true })
166166
{
167-
foreach (var encoderEntry in HtmlEncoderData)
167+
foreach (var encoder in HtmlEncoderData)
168168
{
169-
var encoder = (HtmlEncoder)(encoderEntry[0]);
170169
data.Add(useCachedResult, encoder);
171170
}
172171
}

0 commit comments

Comments
 (0)