Ejemplo n.º 1
0
        public async Task Executes_With_Enabled_Notification_Methods()
        {
            HealthCheckNotifier sut = CreateHealthCheckNotifier();
            await sut.PerformExecuteAsync(null);

            VerifyNotificationsSent();
        }
Ejemplo n.º 2
0
        public async Task Does_Not_Execute_With_No_Enabled_Notification_Methods()
        {
            HealthCheckNotifier sut = CreateHealthCheckNotifier(notificationEnabled: false);
            await sut.PerformExecuteAsync(null);

            VerifyNotificationsNotSent();
        }
Ejemplo n.º 3
0
        public async Task Does_Not_Execute_When_Not_Main_Dom()
        {
            HealthCheckNotifier sut = CreateHealthCheckNotifier(isMainDom: false);
            await sut.PerformExecuteAsync(null);

            VerifyNotificationsNotSent();
        }
Ejemplo n.º 4
0
        public async Task Does_Not_Execute_When_Server_Role_Is_Unknown()
        {
            HealthCheckNotifier sut = CreateHealthCheckNotifier(serverRole: ServerRole.Unknown);
            await sut.PerformExecuteAsync(null);

            VerifyNotificationsNotSent();
        }
Ejemplo n.º 5
0
        public async Task Does_Not_Execute_When_Runtime_State_Is_Not_Run(RuntimeLevel runtimeLevel)
        {
            HealthCheckNotifier sut = CreateHealthCheckNotifier(runtimeLevel: runtimeLevel);
            await sut.PerformExecuteAsync(null);

            VerifyNotificationsNotSent();
        }
Ejemplo n.º 6
0
        public async Task Executes_Only_Enabled_Checks()
        {
            HealthCheckNotifier sut = CreateHealthCheckNotifier();
            await sut.PerformExecuteAsync(null);

            _mockNotificationMethod.Verify(
                x => x.SendAsync(
                    It.Is <HealthCheckResults>(y => y.ResultsAsDictionary.Count == 1 && y.ResultsAsDictionary.ContainsKey("Check1"))), Times.Once);
        }