Ejemplo n.º 1
0
        public void HostFallbackTest()
        {
            var service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/", "http://avail.example.com/api/" });

            service.LoadRegex();
            Assert.That(service.GetApiBase(), Is.EqualTo("http://avail.example.com/api/"));
        }
Ejemplo n.º 2
0
        public async Task HostFallbackTest()
        {
            var service = new TestImgAzyobuziNet(new[] { "http://avail1.example.com/api/", "http://avail2.example.com/api/" });
            await service.LoadRegexAsync();

            Assert.Equal("http://avail1.example.com/api/", service.GetApiBase());

            service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/", "http://avail.example.com/api/" });
            await service.LoadRegexAsync();

            Assert.Equal("http://avail.example.com/api/", service.GetApiBase());

            service = new TestImgAzyobuziNet(new[] { "http://error.example.com/api/", "http://avail.example.com/api/" });
            await service.LoadRegexAsync();

            Assert.Equal("http://avail.example.com/api/", service.GetApiBase());

            service = new TestImgAzyobuziNet(new[] { "http://invalid.example.com/api/", "http://avail.example.com/api/" });
            await service.LoadRegexAsync();

            Assert.Equal("http://avail.example.com/api/", service.GetApiBase());

            service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/" });
            await service.LoadRegexAsync();

            Assert.Null(service.GetApiBase());
        }
        public void ServerOutageTest()
        {
            var service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/" });

            service.LoadRegex();
            Assert.That(service.GetApiBase(), Is.Null);

            var thumbinfo = service.GetThumbnailInfo("http://example.com/abcd", null);

            Assert.That(thumbinfo, Is.Null);
        }
Ejemplo n.º 4
0
        public async Task ServerOutageTest()
        {
            var service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/" });

            await service.LoadRegexAsync();

            Assert.Null(service.GetApiBase());

            var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None);

            Assert.Null(thumbinfo);
        }
Ejemplo n.º 5
0
        public async Task HostFallbackTest()
        {
            var service = new TestImgAzyobuziNet(new[] { "http://avail1.example.com/api/", "http://avail2.example.com/api/" });
            await service.LoadRegexAsync();
            Assert.Equal("http://avail1.example.com/api/", service.GetApiBase());

            service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/", "http://avail.example.com/api/" });
            await service.LoadRegexAsync();
            Assert.Equal("http://avail.example.com/api/", service.GetApiBase());

            service = new TestImgAzyobuziNet(new[] { "http://error.example.com/api/", "http://avail.example.com/api/" });
            await service.LoadRegexAsync();
            Assert.Equal("http://avail.example.com/api/", service.GetApiBase());

            service = new TestImgAzyobuziNet(new[] { "http://invalid.example.com/api/", "http://avail.example.com/api/" });
            await service.LoadRegexAsync();
            Assert.Equal("http://avail.example.com/api/", service.GetApiBase());

            service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/" });
            await service.LoadRegexAsync();
            Assert.Null(service.GetApiBase());
        }
        public void HostFallbackTest()
        {
            var service = new TestImgAzyobuziNet(new[] { "http://avail1.example.com/api/", "http://avail2.example.com/api/" });

            service.LoadRegex();
            Assert.That(service.GetApiBase(), Is.EqualTo("http://avail1.example.com/api/"));

            service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/", "http://avail.example.com/api/" });
            service.LoadRegex();
            Assert.That(service.GetApiBase(), Is.EqualTo("http://avail.example.com/api/"));

            service = new TestImgAzyobuziNet(new[] { "http://error.example.com/api/", "http://avail.example.com/api/" });
            service.LoadRegex();
            Assert.That(service.GetApiBase(), Is.EqualTo("http://avail.example.com/api/"));

            service = new TestImgAzyobuziNet(new[] { "http://invalid.example.com/api/", "http://avail.example.com/api/" });
            service.LoadRegex();
            Assert.That(service.GetApiBase(), Is.EqualTo("http://avail.example.com/api/"));

            service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/" });
            service.LoadRegex();
            Assert.That(service.GetApiBase(), Is.Null);
        }
Ejemplo n.º 7
0
        public void ServerOutageTest()
        {
            var service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/" });

            service.LoadRegex();
            Assert.That(service.GetApiBase(), Is.Null);

            var thumbinfo = service.GetThumbnailInfo("http://example.com/abcd", null);
            Assert.That(thumbinfo, Is.Null);
        }
Ejemplo n.º 8
0
        public async Task ServerOutageTest()
        {
            var service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/" });

            await service.LoadRegexAsync();
            Assert.Null(service.GetApiBase());

            var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None);
            Assert.Null(thumbinfo);
        }