public CommandEnumerationJsonConvertProvider(ICommandJsonConvertProvider commandJsonConvertProvider, IJsonConvertProvider jsonConvertProvider)
        {
            Guard.WhenArgument(commandJsonConvertProvider, nameof(ICommandJsonConvertProvider)).IsNull().Throw();
            Guard.WhenArgument(jsonConvertProvider, nameof(IJsonConvertProvider)).IsNull().Throw();

            this.commandJsonConvertProvider = commandJsonConvertProvider;
            this.jsonConvertProvider        = jsonConvertProvider;
        }
Пример #2
0
        public void ThrowArgumentNullException_WhenIJsonConvertProviderParameterIsNull()
        {
            // Arrange
            var commandUtilizationUpdateStrategy = new Mock <ICommandUtilizationUpdateStrategy>();
            var signalRHubConnectionService      = new Mock <ISignalRHubConnectionService>();
            ICommandJsonConvertProvider commandJsonConvertProvider = null;
            var remoteUserProvider = new Mock <IRemoteUserProvider>();

            // Act & Assert
            Assert.That(
                () => new SignalRCommandUtilizationStrategy(commandUtilizationUpdateStrategy.Object, signalRHubConnectionService.Object, commandJsonConvertProvider, remoteUserProvider.Object),
                Throws.InstanceOf <ArgumentNullException>().With.Message.Contains(nameof(IJsonConvertProvider)));
        }
Пример #3
0
        public SignalRCommandUtilizationStrategy(ICommandUtilizationUpdateStrategy commandUtilizationUpdateStrategy, ISignalRHubConnectionService signalRHubConnectionService, ICommandJsonConvertProvider commandJsonConvertProvider, IRemoteUserProvider remoteUserProvider)
        {
            Guard.WhenArgument(signalRHubConnectionService, nameof(ISignalRHubConnectionService)).IsNull().Throw();

            Guard.WhenArgument(commandUtilizationUpdateStrategy, nameof(ICommandUtilizationUpdateStrategy)).IsNull().Throw();
            Guard.WhenArgument(commandJsonConvertProvider, nameof(IJsonConvertProvider)).IsNull().Throw();
            Guard.WhenArgument(remoteUserProvider, nameof(IRemoteUserProvider)).IsNull().Throw();

            this.commandUtilizationUpdateStrategy = commandUtilizationUpdateStrategy;
            this.commandJsonConvertProvider       = commandJsonConvertProvider;
            this.remoteUserProvider = remoteUserProvider;

            this.logFileParserHubProxyProvider = signalRHubConnectionService.GetHubProxyProvider(SignalRCommandUtilizationStrategy.HubName);

            this.InitializeLogFileParserHubProxy(this.logFileParserHubProxyProvider);

            this.GetParsingSessionId(this.logFileParserHubProxyProvider);
        }
Пример #4
0
 internal MockSignalRCommandUtilizationStrategy(ICommandUtilizationUpdateStrategy commandUtilizationUpdateStrategy, ISignalRHubConnectionService signalRHubConnectionService, ICommandJsonConvertProvider commandJsonConvertProvider, IRemoteUserProvider remoteUserProvider)
     : base(commandUtilizationUpdateStrategy, signalRHubConnectionService, commandJsonConvertProvider, remoteUserProvider)
 {
 }