pull/4458/head
crobibero 4 years ago
parent dae4541bad
commit 056c44010b

@ -177,7 +177,7 @@ namespace Jellyfin.Api.Tests.ModelBinders
{ {
var queryParamName = "test"; var queryParamName = "test";
var queryParamString = "🔥,😢"; var queryParamString = "🔥,😢";
var queryParamType = typeof(TestType[]); var queryParamType = typeof(IReadOnlyList<TestType>);
var modelBinder = new CommaDelimitedArrayModelBinder(new NullLogger<CommaDelimitedArrayModelBinder>()); var modelBinder = new CommaDelimitedArrayModelBinder(new NullLogger<CommaDelimitedArrayModelBinder>());
var valueProvider = new QueryStringValueProvider( var valueProvider = new QueryStringValueProvider(
@ -192,7 +192,7 @@ namespace Jellyfin.Api.Tests.ModelBinders
await modelBinder.BindModelAsync(bindingContextMock.Object); await modelBinder.BindModelAsync(bindingContextMock.Object);
Assert.True(bindingContextMock.Object.Result.IsModelSet); Assert.True(bindingContextMock.Object.Result.IsModelSet);
Assert.Empty((TestType[])bindingContextMock.Object.Result.Model); Assert.Empty((IReadOnlyList<TestType>?)bindingContextMock.Object.Result.Model);
} }
[Fact] [Fact]
@ -201,7 +201,7 @@ namespace Jellyfin.Api.Tests.ModelBinders
var queryParamName = "test"; var queryParamName = "test";
var queryParamString1 = "How"; var queryParamString1 = "How";
var queryParamString2 = "😱"; var queryParamString2 = "😱";
var queryParamType = typeof(TestType[]); var queryParamType = typeof(IReadOnlyList<TestType>);
var modelBinder = new CommaDelimitedArrayModelBinder(new NullLogger<CommaDelimitedArrayModelBinder>()); var modelBinder = new CommaDelimitedArrayModelBinder(new NullLogger<CommaDelimitedArrayModelBinder>());
@ -220,7 +220,7 @@ namespace Jellyfin.Api.Tests.ModelBinders
await modelBinder.BindModelAsync(bindingContextMock.Object); await modelBinder.BindModelAsync(bindingContextMock.Object);
Assert.True(bindingContextMock.Object.Result.IsModelSet); Assert.True(bindingContextMock.Object.Result.IsModelSet);
Assert.Single((TestType[])bindingContextMock.Object.Result.Model); Assert.Single((IReadOnlyList<TestType>?)bindingContextMock.Object.Result.Model);
} }
} }
} }

Loading…
Cancel
Save