Пример #1
0
        public void ThrowArgumentNullException_WhenIHubConnectionProviderFactoryParameterIsNull()
        {
            // Arrange
            IHubConnectionProviderFactory hubConnectionProviderFactory = null;
            var hubProxyProviderFactory = new Mock <IHubProxyProviderFactory>();

            // Act & Assert
            Assert.That(
                () => new SignalRHubConnectionService(hubConnectionProviderFactory, hubProxyProviderFactory.Object),
                Throws.InstanceOf <ArgumentNullException>().With.Message.Contains(nameof(IHubConnectionProviderFactory)));
        }
Пример #2
0
        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)
 {
 }