예제 #1
0
 public void DownloadPackageFromDirectoryTest()
 {
     try
     {
         Directory.CreateDirectory(fr_path);
         string inside_dir  = "InsideDirectory";
         string inside_path = Path.Combine(fr_path, inside_dir);
         Directory.CreateDirectory(inside_path);
         Upset test_package = new Upset()
         {
             PackageLicense = "foo",
             PackageName    = "bar",
             PackageVersion = "baz"
         };
         test_package.MetaInformation.dirName = inside_dir;
         string file_dummy = "Testing.foobar";
         File.Create(Path.Combine(inside_path, file_dummy)).Dispose();
         TemporaryDirectory result = fr.DownloadPackage(test_package);
         Assert.IsTrue(Directory.Exists(result.Path));
         CollectionAssert.Contains(Directory.GetFiles(result.Path).Select(Path.GetFileName).ToArray(), file_dummy);
     }
     finally
     {
         Directory.Delete(fr_path, true);
     }
 }