コード例 #1
0
        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));
        }
コード例 #2
0
 public void GetMirrors_loads_mirror_list_from_web()
 {
     mirrorProvider.GetMirrors();
     downloader.Verify(d => d.Download());
 }
コード例 #3
0
        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));
        }