Esempio n. 1
0
        /// <summary>
        /// Initialize mock objects.
        /// </summary>
        public PoolTests()
        {
            _jobManagerFactory = Substitute.For<IJobManagerFactory>();
            _jobTrackerFactory = Substitute.For<IJobTrackerFactory>();
            _hashAlgorithmFactory = Substitute.For<IHashAlgorithmFactory>();
            _shareManagerFactory = Substitute.For<IShareManagerFactory>();
            _minerManagerFactory = Substitute.For<IMinerManagerFactory>();
            _serverFactory = Substitute.For<IServerFactory>();
            _serviceFactory = Substitute.For<IServiceFactory>();
            _storageManagerFactory = Substitute.For<IStorageFactory>();
            _globalConfigFactory = Substitute.For<IGlobalConfigFactory>();

            _daemonClient = Substitute.For<IDaemonClient>();
            _minerManager = Substitute.For<IMinerManager>();
            _jobManager = Substitute.For<IJobManager>();
            _jobTracker = Substitute.For<IJobTracker>();
            _shareManager = Substitute.For<IShareManager>();
            _miningServer = Substitute.For<IMiningServer>();
            _rpcService = Substitute.For<IRpcService>();
            _storage = Substitute.For<IStorage>();
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Pool" /> class.
        /// </summary>
        /// <param name="hashAlgorithmFactory">The hash algorithm factory.</param>
        /// <param name="serverFactory">The server factory.</param>
        /// <param name="serviceFactory">The service factory.</param>
        /// <param name="client">The client.</param>
        /// <param name="minerManagerFactory">The miner manager factory.</param>
        /// <param name="jobTrackerFactory"></param>
        /// <param name="jobManagerFactory">The job manager factory.</param>
        /// <param name="shareManagerFactory">The share manager factory.</param>
        /// <param name="storageManagerFactory"></param>
        /// <param name="globalConfigFactory"></param>
        public Pool(
            IHashAlgorithmFactory hashAlgorithmFactory, 
            IServerFactory serverFactory, 
            IServiceFactory serviceFactory,
            IDaemonClient client, 
            IMinerManagerFactory minerManagerFactory, 
            IJobTrackerFactory jobTrackerFactory,
            IJobManagerFactory jobManagerFactory, 
            IShareManagerFactory shareManagerFactory,
            IStorageFactory storageManagerFactory,
            IGlobalConfigFactory globalConfigFactory)
        {
            Enforce.ArgumentNotNull(hashAlgorithmFactory, "IHashAlgorithmFactory");
            Enforce.ArgumentNotNull(serverFactory, "IServerFactory");
            Enforce.ArgumentNotNull(serviceFactory, "IServiceFactory");
            Enforce.ArgumentNotNull(client, "IDaemonClient");
            Enforce.ArgumentNotNull(minerManagerFactory, "IMinerManagerFactory");
            Enforce.ArgumentNotNull(jobTrackerFactory, "IJobTrackerFactory");
            Enforce.ArgumentNotNull(jobManagerFactory, "IJobManagerFactory");
            Enforce.ArgumentNotNull(shareManagerFactory, "IShareManagerFactory");
            Enforce.ArgumentNotNull(storageManagerFactory, "IStorageFactory");
            Enforce.ArgumentNotNull(globalConfigFactory, "IGlobalConfigFactory");

            _daemonClient = client;
            _minerManagerFactory = minerManagerFactory;
            _jobManagerFactory = jobManagerFactory;
            _jobTrackerFactory = jobTrackerFactory;
            _shareManagerFactory = shareManagerFactory;
            _serverFactory = serverFactory;
            _serviceFactory = serviceFactory;
            _hashAlgorithmFactory = hashAlgorithmFactory;
            _storageManagerFactory = storageManagerFactory;
            _globalConfigFactory = globalConfigFactory;

            GenerateInstanceId();
        }