Наследование: FolderStructure
Пример #1
0
        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)");
        }
Пример #2
0
 public Library_V3 CreateLibrary(Library library)
 {
     editArticles.demand(); resetCache(); return tmXmlDatabase.xmlDB_NewGuidanceExplorer(library).libraryV3();
 }
Пример #3
0
 //***********
 //  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();
 }
Пример #4
0
 public bool UpdateLibrary(Library library)
 {
     editArticles.demand(); resetCache(); return tmXmlDatabase.xmlDB_UpdateGuidanceExplorer(library);
 }
Пример #5
0
 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);
 }
Пример #6
0
 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;
 }
Пример #7
0
 public Library_V3 CreateLibrary(Library library)
 {
     resetCache(); return tmXmlDatabase.xmlDB_NewGuidanceExplorer(library.id.guid(), library.caption).libraryV3();
 }
Пример #8
0
 public bool UpdateLibrary(Library library)
 {
     resetCache(); return tmXmlDatabase.xmlDB_UpdateGuidanceExplorer(library.id.guid(), library.caption, library.delete);
 }