public void Can_extract_list_of_mirrors_from_html() { var provider = new SourceForgeMirrorProvider(); var mirrors = provider.GetMirrors(TestResponseHtml); Assert.IsNotNull(mirrors); foreach (var mirror in mirrors) { Console.WriteLine(mirror.Id + ":" + mirror.Name); } Assert.AreEqual(25, mirrors.Count()); Assert.IsNotNull(mirrors.FirstOrDefault(mirror => mirror.Name.IndexOf("Transact", StringComparison.OrdinalIgnoreCase) > -1)); Assert.IsNotNull(mirrors.FirstOrDefault(mirror => mirror.Id.IndexOf("transact", StringComparison.OrdinalIgnoreCase) > -1)); }
public void GetMirrors_loads_mirror_list_from_web() { mirrorProvider.GetMirrors(); downloader.Verify(d => d.Download()); }
public void Can_extract_list_of_mirrors_from_html() { var provider = new SourceForgeMirrorProvider(); var mirrors = provider.GetMirrors(TestResponseHtml); Assert.IsNotNull(mirrors); foreach (var mirror in mirrors) { Console.WriteLine(mirror.Id + ":" + mirror.Name); } Assert.AreEqual(25, mirrors.Count()); Assert.IsNotNull(mirrors.FirstOrDefault(mirror => mirror.Name.IndexOf("Transact",StringComparison.OrdinalIgnoreCase) > -1)); Assert.IsNotNull(mirrors.FirstOrDefault(mirror => mirror.Id.IndexOf("transact", StringComparison.OrdinalIgnoreCase) > -1)); }