public void Delete() { // Delete non existance of file. try { ListingService.Delete(path + @"\delete.txt"); Assert.Fail(); } catch (ByteTurnNotFoundException byteturnex) { Assert.AreEqual(typeof(ByteTurnNotFoundException), byteturnex.GetType()); } // Illegal characters. try { ListingService.Delete(path + @"\dele|te.txt"); Assert.Fail(); } catch (ByteTurnNotSupportedException byteturnex) { Assert.AreEqual(typeof(ByteTurnNotSupportedException), byteturnex.GetType()); } var p = ListingService.Create("testfile-3.txt", path, ListingTypeOption.File, DuplicateListingActionOption.NoAction); ListingService.Delete(path + @"\testfile-3.txt"); }
public void Init() { path = Path.GetFullPath(path); parentPath = Path.GetFullPath(parentPath); testPath = Path.GetFullPath(testPath); if (!ListingService.Exists(path)) { ListingService.Create("Test", parentPath, Data.Listing.ListingTypeOption.Directory, Data.Listing.DuplicateListingActionOption.NoAction); } var deleteFiles = ListingService.GetListingByDirectory(path, true, true); foreach (var f in deleteFiles) { ListingService.Delete(f.FullFilePath); } var testFiles = ListingService.GetListingByDirectory(testPath, false, true); foreach (var f in testFiles) { ListingService.Copy(f.FullFilePath, path + @"\" + f.Name); } }
public ActionResult <string> Delete(int id) { try { return(Ok(_bs.Delete(id))); } catch (System.Exception err) { return(BadRequest(err)); } }