public void CreateLibrary_and_UpdateLibrary() { var newLibrary = new Library { id = Guid.NewGuid().str(), caption = "temp_lib_{0}".format(6.randomLetters()) }; tmWebServices.CreateLibrary(newLibrary); var createdLibrary = tmWebServices.GetLibraryById(newLibrary.id.guid()); Assert.That(createdLibrary.notNull(), "could not fetch new Library with Id: {0}".format(newLibrary.id)); createdLibrary.caption += "_toDelete"; tmWebServices.UpdateLibrary(createdLibrary); var updatedLibrary = tmWebServices.GetLibraryById(createdLibrary.id.guid()); Assert.That(updatedLibrary.id == createdLibrary.id , "in updated, id didn't match created library"); Assert.That(updatedLibrary.caption == createdLibrary.caption , "in updated, caption didn't match"); Assert.That(updatedLibrary.delete == createdLibrary.delete , "in updated, delete didn't match"); Assert.That(updatedLibrary.caption != newLibrary.caption , "in updated, caption should be different that newLibrary"); Assert.That(updatedLibrary.id.contains(newLibrary.id) , "in updated, id didn't match new library object"); updatedLibrary.delete = true; var deleteResult = tmWebServices.UpdateLibrary(updatedLibrary); var deletedLibrary = tmWebServices.GetLibraryById(updatedLibrary.id.guid()); Assert.IsTrue(deleteResult , "deleteResult was not true"); Assert.IsNull(deletedLibrary, "deletedLibrary should not be there (GetLibraryById returned it)"); }
public Library_V3 CreateLibrary(Library library) { editArticles.demand(); resetCache(); return tmXmlDatabase.xmlDB_NewGuidanceExplorer(library).libraryV3(); }
//*********** // helper methods Imported from previews version of this test (see if we still need them here) public Guid createTempLibrary() { "creating temp library".info(); var newLibrary = new Library { id = Guid.NewGuid().str(), caption = "temp_lib_{0}".format(6.randomLetters()) }; tmWebServices.CreateLibrary(newLibrary); return newLibrary.id.guid(); }
public bool UpdateLibrary(Library library) { editArticles.demand(); resetCache(); return tmXmlDatabase.xmlDB_UpdateGuidanceExplorer(library); }
public bool RenameLibrary(Guid libraryId, string newName) { editArticles.demand(); resetCache(); if (GetLibraryById(libraryId).isNull()) return false; var libraryToRename = new Library { id = libraryId.str(), caption = newName }; return UpdateLibrary(libraryToRename); }
public bool DeleteLibrary(Guid libraryId) { editArticles.demand(); resetCache(); if (GetLibraryById(libraryId).isNull()) return false; var libraryToDelete = new Library { id = libraryId.str(), delete = true }; UpdateLibrary(libraryToDelete); var libraryDeleted = GetLibraryById(libraryId); return libraryDeleted.isNull();// || libraryDeleted.delete; }
public Library_V3 CreateLibrary(Library library) { resetCache(); return tmXmlDatabase.xmlDB_NewGuidanceExplorer(library.id.guid(), library.caption).libraryV3(); }
public bool UpdateLibrary(Library library) { resetCache(); return tmXmlDatabase.xmlDB_UpdateGuidanceExplorer(library.id.guid(), library.caption, library.delete); }