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"); } }
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"); } }
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(); } }