コード例 #1
0
        public void ErrorsShouldBeInitializedToEmptyIDictionaryImplementation()
        {
            var result = new ServiceCheckResult();

            Assert.NotNull(result.Errors);
            Assert.Empty(result.Errors);
        }
コード例 #2
0
        public void EndpointHealthyShouldReturnTrueIfThereIsNoErrorWithGivenUrlInErrors()
        {
            var result = new ServiceCheckResult()
            {
                Service = TestService
            };

            Assert.True(result.EndpointHealthy(TestService.PublicNetworkUrl));
        }
コード例 #3
0
        public void EndpointHealthyShouldThrowArgumentExceptionWhenPassedUrlIsNotInTheServicesUrls()
        {
            var result = new ServiceCheckResult()
            {
                Service = TestService
            };

            Assert.ThrowsAny <ArgumentException>(() => result.EndpointHealthy("http://localhost:9999"));
        }
コード例 #4
0
        public void EndpointHealthyShouldReturnFalseIfThereIsAtLeastOneErrorWithGivenUrlInErrors()
        {
            var testUrl = TestService.PublicNetworkUrl;

            var result = new ServiceCheckResult()
            {
                Service = TestService
            };

            result.Errors.Add(testUrl, "some error");

            Assert.False(result.EndpointHealthy(testUrl));
        }
コード例 #5
0
        public void EndpointHealthyShouldThrowArgumentExceptionWhenNullEmptyWhitespaceUrlPassed(string url)
        {
            var result = new ServiceCheckResult();

            Assert.ThrowsAny <ArgumentException>(() => result.EndpointHealthy(url));
        }