예제 #1
0
        public PerfionClientInstaller(TConnection connection, IPerfionClientConfiguration configuration)
        {
            if (connection == null)
            {
                throw new ArgumentNullException(nameof(connection));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            _connection    = connection;
            _configuration = configuration;
        }
예제 #2
0
        private PerfionClientImpl CreateSubject(ArchiveOptions globalArchiveOptions = null)
        {
            _archiveService = Substitute.For <IArchiveService>();
            _kernel         = Substitute.For <IKernel>();
            _kernel.Resolve <IArchiveService>().Returns(_archiveService);
            _proxy         = Substitute.For <GetDataSoap>();
            _connection    = new ConnectionStub(_proxy);
            _configuration = new ConfigurationStub(globalArchiveOptions);

            var beginArchive = new BeginArchive("name", (options, stream) => { });

            _archiveService.Create(Arg.Any <string>(), Arg.Any <Action <ArchiveCreated> >()).Returns(beginArchive);

            var subject = new PerfionClientImpl(_connection, _configuration, _kernel);

            return(subject);
        }
예제 #3
0
        public PerfionClientFactory(TConnection connection, IPerfionClientConfiguration configuration, IKernel kernel)
        {
            if (connection == null)
            {
                throw new ArgumentNullException(nameof(connection));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }
            if (kernel == null)
            {
                throw new ArgumentNullException(nameof(kernel));
            }

            _client = new Lazy <IPerfionClient>(() => new PerfionClientImpl(connection, configuration, kernel));
        }
        public PerfionClientImpl(Connection connection, IPerfionClientConfiguration configuration, IKernel kernel)
        {
            if (connection == null)
            {
                throw new ArgumentNullException(nameof(connection));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }
            if (kernel == null)
            {
                throw new ArgumentNullException(nameof(kernel));
            }

            _connection    = connection;
            _configuration = configuration;
            _kernel        = kernel;
        }