Initializing HubOptions.JsonSerializationSettings to default settings
This commit is contained in:
parent
b4c61b6c2d
commit
9e614b6cc7
|
|
@ -7,6 +7,6 @@ namespace Microsoft.AspNetCore.SignalR
|
|||
{
|
||||
public class HubOptions
|
||||
{
|
||||
public JsonSerializerSettings JsonSerializerSettings { get; set; }
|
||||
public JsonSerializerSettings JsonSerializerSettings { get; set; } = new JsonSerializerSettings();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.Reactive.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CSharp;
|
||||
|
||||
namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.SignalR.Tests
|
||||
{
|
||||
public class SignalRDependencyInjectionExtensionsTests
|
||||
{
|
||||
[Fact]
|
||||
public void JSonSerializerSettingsShouldNotBeNullInOptions()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
services.AddOptions();
|
||||
services.AddSignalR();
|
||||
var serviceProvider = services.BuildServiceProvider();
|
||||
var hubOptions = serviceProvider.GetService<IOptions<HubOptions>>();
|
||||
Assert.NotNull(hubOptions.Value.JsonSerializerSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue