Пример #1
0
 public void KnownTorrentWithSeveralItemsIsDownloadable()
 {
     var handle = new ManualResetEvent(false);
     using (var binRep = new TestingBinRepository())
     using (var tEnv = new TorrentEnvironment())
     {
         Console.WriteLine("Binrep Root: {0}", binRep.Root);
         var d = new Downloader(binRep, tEnv);
         var sw = Stopwatch.StartNew();
         d.GetBin(MultiTorrentFile, handle);
         handle.WaitOne();
         Console.WriteLine(sw.ElapsedMilliseconds);
         var binContents = binRep.Get("acme inc./acme multi/1.1.0.0").ToList();
         binContents.ShouldHaveCount(2);
         binContents.Any(ri=>ri.PhysicalName == "multiAssembly.dll").ShouldBeTrue();
         binContents.Any(ri => ri.PhysicalName == "utility.dll").ShouldBeTrue();
     }
 }
Пример #2
0
 public void KnownTorrentWithRemoteAssemblyIsDownloadable()
 {
     var handle = new ManualResetEvent(false);
     using (var binRep = new TestingBinRepository())
     using (var tEnv = new TorrentEnvironment())
     {
         Console.WriteLine("Binrep Root: {0}", binRep.Root);
         var d = new Downloader(binRep, tEnv);
         var sw = Stopwatch.StartNew();
         d.GetBin(SingleTorrentFile, handle);
         handle.WaitOne();
         Console.WriteLine(sw.ElapsedMilliseconds);
         var binContents = binRep.Get("acme inc./acme stuff/1.0.0.0").ToList();
         binContents[0].PhysicalName.ShouldBeEqualTo("testAssembly.dll");
     }
 }