Example #1
0
        /// <summary>
        /// Initialize scan result service.
        /// </summary>
        /// <param name="db">Mongo database.</param>
        /// <param name="bucket">GridFS bucket.</param>
        /// <param name="scanBackendService">Scan backend service.</param>
        public ScanResultService(IMongoDatabase db, IGridFSBucket bucket, IScanBackendService scanBackendService)
        {
            _bucket             = bucket;
            _scanBackendService = scanBackendService;

            _collection = db.GetCollection <ScanResult>(CollectionName);
        }
        public void SetUp()
        {
            var configuration = new ConfigurationRoot(new List <IConfigurationProvider>
            {
                new MemoryConfigurationProvider(new MemoryConfigurationSource())
            })
            {
                ["BackendsConfiguration"] = "backends.yaml"
            };

            _busMock = new Mock <IBus>();

            _scanBackendService = new ScanBackendService(
                configuration,
                _busMock.Object,
                Mock.Of <ILogger <ScanBackendService> >());
        }