Exemplo n.º 1
0
 public static bool DestroyDrive()
 {
     var driveService = new OHDriveService();
     var drives = driveService.GetAll().Result;
     var driveToDelete = drives.FirstOrDefault(x => x.Name == "oh-api-test");
     
     return driveService.Destroy(driveToDelete.DriveID).Result;
 }
Exemplo n.º 2
0
        public static OHDrive SetDrive()
        {
            var driveService = new OHDriveService();
            var driveOptions = new OHDriveOptions();
            driveOptions.ClaimType = "exclusive";
            driveOptions.Encryption = "none";
            driveOptions.Tags = new[] { "newtest", "c-sharp-api-v2" };
            var drives = driveService.GetAll().Result;
            var drive = drives.FirstOrDefault(x => x.Name == "oh-api-test");

            return driveService.Set(drive.DriveID, drive.Name, 1073741824, driveOptions).Result;
        }
Exemplo n.º 3
0
 public static OHDrive CreateDrive()
 {
     var driveService = new OHDriveService();
     
     return driveService.Create("oh-api-test", 536870912, null).Result;
 }
Exemplo n.º 4
0
 public static List<OHDrive> GetAllDrives()
 {
     var driveService = new OHDriveService();
     
     return driveService.GetAll().Result;
 }
 public void Get()
 {
     var testDriveName = "oh-api-test";
     var drive = new OHDriveService().Get("5e2f2e24-079d-4f9f-8a4c-287ca044d01d").Result;
     Assert.AreEqual(testDriveName, drive.Name);
 }
 public void GetAll()
 {
     var drives = new OHDriveService().GetAll().Result;
     Assert.AreEqual<int>(1, drives.Count);
 }