コード例 #1
0
ファイル: Constructor_Should.cs プロジェクト: shakuu/Parser
        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)));
        }
コード例 #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);
        }
コード例 #3
0
 internal MockSignalRHubConnectionService(IHubConnectionProviderFactory hubConnectionProviderFactory, IHubProxyProviderFactory hubProxyProviderFactory)
     : base(hubConnectionProviderFactory, hubProxyProviderFactory)
 {
 }