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/")); }
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); }
public void HostFallbackTest() { var service = new TestImgAzyobuziNet(new[] { "http://avail1.example.com/api/", "http://avail2.example.com/api/" }); service.LoadRegex(); Assert.Equal("http://avail1.example.com/api/", service.GetApiBase()); service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/", "http://avail.example.com/api/" }); service.LoadRegex(); Assert.Equal("http://avail.example.com/api/", service.GetApiBase()); service = new TestImgAzyobuziNet(new[] { "http://error.example.com/api/", "http://avail.example.com/api/" }); service.LoadRegex(); Assert.Equal("http://avail.example.com/api/", service.GetApiBase()); service = new TestImgAzyobuziNet(new[] { "http://invalid.example.com/api/", "http://avail.example.com/api/" }); service.LoadRegex(); Assert.Equal("http://avail.example.com/api/", service.GetApiBase()); service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/" }); service.LoadRegex(); 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); }
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); }