public void ThrowArgumentNullException_WhenIHubProxyProviderFactoryParameterIsNull() { // Arrange var hubConnectionProviderFactory = new Mock <IHubConnectionProviderFactory>(); IHubProxyProviderFactory hubProxyProviderFactory = null; // Act & Assert Assert.That( () => new SignalRHubConnectionService(hubConnectionProviderFactory.Object, hubProxyProviderFactory), Throws.InstanceOf <ArgumentNullException>().With.Message.Contains(nameof(IHubProxyProviderFactory))); }
public SignalRHubConnectionService(IHubConnectionProviderFactory hubConnectionProviderFactory, IHubProxyProviderFactory hubProxyProviderFactory) { Guard.WhenArgument(hubConnectionProviderFactory, nameof(IHubConnectionProviderFactory)).IsNull().Throw(); Guard.WhenArgument(hubProxyProviderFactory, nameof(IHubProxyProviderFactory)).IsNull().Throw(); this.hubConnectionProvider = hubConnectionProviderFactory.CreateHubConnectionProvider(SignalRHubConnectionService.HubConnectionAzure); this.hubProxyProviderFactory = hubProxyProviderFactory; this.hubProxyProviders = new Dictionary <string, IHubProxyProvider>(); this.StartHubConnection(this.hubConnectionProvider); }
internal MockSignalRHubConnectionService(IHubConnectionProviderFactory hubConnectionProviderFactory, IHubProxyProviderFactory hubProxyProviderFactory) : base(hubConnectionProviderFactory, hubProxyProviderFactory) { }