public void can_register_process_virtual_memory_check()
        {
            var healthChecks = Enumerable.Empty <HealthCheck>();
            var name         = "virtual memory";

            var factory = new HealthCheckFactory(_logger, healthChecks);

            factory.RegisterProcessVirtualMemorySizeHealthCheck(name, 100);

            factory.Checks.Should().NotBeEmpty();
            factory.Checks.Single().Value.Name.Should().Be(name);
        }
        public async Task can_execute_process_virtual_memory_check()
        {
            var healthChecks = Enumerable.Empty <HealthCheck>();
            var name         = "virtual memory";

            var factory = new HealthCheckFactory(_logger, healthChecks);

            factory.RegisterProcessVirtualMemorySizeHealthCheck(name, long.MaxValue);

            var check  = factory.Checks.FirstOrDefault();
            var result = await check.Value.ExecuteAsync().ConfigureAwait(false);

            result.Check.Status.Should().Be(HealthCheckStatus.Healthy);
        }
        public async Task can_execute_process_virtual_memory_check(HealthCheckStatus expectedResult, long thresholdBytes, bool degradedOnError = false)
        {
            var healthChecks = Enumerable.Empty <HealthCheck>();
            var name         = "virtual memory";

            var factory = new HealthCheckFactory(_logger, new Lazy <IMetrics>(), healthChecks);

            factory.RegisterProcessVirtualMemorySizeHealthCheck(name, thresholdBytes, degradedOnError);

            var check  = factory.Checks.FirstOrDefault();
            var result = await check.Value.ExecuteAsync().ConfigureAwait(false);

            result.Check.Status.Should().Be(expectedResult);
        }