public void SingleDownload() { // Force log4net on. // BasicConfigurator.Configure(); // LogManager.GetRepository().Threshold = Level.Debug; log.Info("Performing single download test."); // We know kOS is in the TestKAN data, and hosted in KS. Let's get it. var modules = new List <CfanModule>(); CfanModule kOS = registry.LatestAvailable("kOS", null); Assert.IsNotNull(kOS); modules.Add(kOS); // Make sure we don't alread have kOS somehow. Assert.IsFalse(cache.IsCached(kOS.download)); // log.InfoFormat("Downloading kOS from {0}", kOS.download); // Download our module. async.DownloadModules( ksp.KSP.Cache, modules ); // Assert that we have it, and it passes zip validation. Assert.IsTrue(cache.IsCachedZip(kOS.download)); }
public void SingleDownload() { log.Info("Performing single download test."); // We know kOS is in the TestKAN data, and hosted in KS. Let's get it. var modules = new List <CkanModule>(); CkanModule kOS = registry.LatestAvailable("kOS", null); Assert.IsNotNull(kOS); modules.Add(kOS); // Make sure we don't alread have kOS somehow. Assert.IsFalse(cache.IsCached(kOS.download)); // log.InfoFormat("Downloading kOS from {0}", kOS.download); // Download our module. async.DownloadModules( ksp.KSP.Cache, modules ); // Assert that we have it, and it passes zip validation. Assert.IsTrue(cache.IsCachedZip(kOS.download)); }
public void ZipValidation() { // We could use any URL, but this one is awesome. <3 Uri url = new Uri("http://kitte.nz/"); Assert.IsFalse(cache.IsCachedZip(url)); // Store a bad zip. cache.Store(url, TestData.DogeCoinFlagZipCorrupt()); // Make sure it's stored, but not valid as a zip Assert.IsTrue(cache.IsCached(url)); Assert.IsFalse(cache.IsCachedZip(url)); // Store a good zip. cache.Store(url, TestData.DogeCoinFlagZip()); // Make sure it's stored, and valid. Assert.IsTrue(cache.IsCached(url)); Assert.IsTrue(cache.IsCachedZip(url)); }