예제 #1
0
        public async Task RunAsync_AllBucketsWithDocumentCountWithinThreshold_OkayNotification(NotificationLevel expectedLevel)
        {
            _bucketConfig2.SetupGet(x => x.BasicStats).Returns(new BasicStats {
                ItemCount = _belowThreshold
            });

            ICheckResult result = await _target.RunAsync();

            Assert.AreEqual(expectedLevel, result.Level);
            Assert.IsTrue(result.RenderPlainText().Contains("Bucket document count within expected range"));
            _clusterService.Verify(x => x.GetClusterInfoAsync(), Times.Once);
        }
예제 #2
0
        public async Task RunAsync_ClusterApiCannotBeAccessed_CriticalNotification(NotificationLevel expectedLevel)
        {
            var msg = "Cannot Access Cluster";
            var ex  = new CannotAccesClusterInfoException(msg, new Exception());

            _clusterService.Setup(x => x.GetClusterInfoAsync()).ThrowsAsync(ex);

            ICheckResult result = await _target.RunAsync();

            Assert.AreEqual(expectedLevel, result.Level);
            Assert.IsTrue(result.RenderPlainText().Contains(msg));
            _clusterService.Verify(x => x.GetClusterInfoAsync(), Times.Once);
        }