/// <summary> /// Initialise scan hosted service. /// </summary> /// <param name="logger">Logger.</param> /// <param name="backend">Scan backend.</param> /// <param name="bus">EasyNetQ bus.</param> public ScanHostedService( ILogger <ScanHostedService> logger, IScanBackend backend, IBus bus) { _logger = logger; _bus = bus; _backend = backend; }
/// <summary> /// Initialize scan background job. /// </summary> /// <param name="configuration">Configuration.</param> /// <param name="bus">Bus.</param> /// <param name="logger">Logger.</param> /// <param name="backend">Scan backend.</param> public ScanBackgroundJob(IConfiguration configuration, IBus bus, ILogger <ScanBackgroundJob> logger, IScanBackend backend) { _configuration = configuration; _bus = bus; _logger = logger; _backend = backend; }
/// <summary> /// Initialise scan hosted service. /// </summary> /// <param name="logger">Logger.</param> /// <param name="backend">Scan backend.</param> /// <param name="bus">EasyNetQ bus.</param> /// <param name="configuration">Configuration.</param> public ScanHostedService( ILogger <ScanHostedService> logger, IScanBackend backend, IBus bus, IConfiguration configuration) { _logger = logger; _bus = bus; _configuration = configuration; _backend = backend; }
/// <summary> /// Initialize scan background job. /// </summary> /// <param name="configuration">Configuration.</param> /// <param name="logger">Logger.</param> /// <param name="backend">Scan backend.</param> /// <param name="jobClient">Background job client.</param> public ScanBackgroundJob( IScanBackend backend, IConfiguration configuration, ILogger <ScanBackgroundJob> logger, IBackgroundJobClient jobClient) { _backend = backend; _configuration = configuration; _logger = logger; _jobClient = jobClient; }
/// <summary> /// Initialize consul hosted service. /// </summary> /// <param name="consulClient">Consul client.</param> /// <param name="scanBackend">Scan backend.</param> public ConsulHostedService( IConsulClient consulClient, IScanBackend scanBackend) { _consulClient = consulClient; _registration = new AgentServiceRegistration { ID = ServiceId, Name = "scanner", Meta = new Dictionary <string, string> { { "BackendId", scanBackend.Id } } }; }
private static async Task TestVirusNotDetected(IScanBackend backend) { Assert.IsEmpty(await backend.ScanAsync("test.exe", default)); }
private static async Task TestVirusDetected(IScanBackend backend) { Assert.Contains("Malware-Test-Result", await backend.ScanAsync("test.exe", default)); }