示例#1
0
 public void GetTorrentDepositsTorrentAtRoot()
 {
     using (var binRep = new TestingBinRepository())
     {
         var bt = SingleTorrentFile.AsBinTorrent();
         binRep.Put(bt);
         var item = binRep.Get("acme inc./acme stuff/1.0.0.0");
         item.BinTorrent.ShouldNotBeNull();
         item.BinTorrent.Product.ShouldBeEqualTo("acme stuff");
     }
 }
示例#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");
     }
 }
示例#3
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();
     }
 }