// ProjectKeywordCategory Generics ProjectKeywordCategory SetupProjectKeywordCategory() { ProjectKeywordCategory item = new ProjectKeywordCategory(); item.Name = "RESTClient Test ProjectKeywordCategory"; return(item); }
// Creates a Project Keyword Category public ProjectKeywordCategory CreateProjectKeywordCategory() { Console.Write("Creating Project Keyword Category: "); ProjectKeywordCategory projectKeywordCategoryItem = new ProjectKeywordCategory(); projectKeywordCategoryItem.Name = this.test_id; ProjectKeywordCategory resp = this.conn.SendObject <ProjectKeywordCategory>(projectKeywordCategoryItem, true); Console.WriteLine(resp.Id); return(resp); }
bool CompareProjectKeywordCategory(ProjectKeywordCategory first, ProjectKeywordCategory second) { if (first.Id != second.Id) { return(false); } if (first.Name != second.Name) { return(false); } return(true); }
// Initiates the test public void init() { Category projectCategory = GetProjectCategoryId(); ProjectKeywordCategory projectKeywordCategory = CreateProjectKeywordCategory(); ProjectKeyword projectKeyword = CreateProjectKeyword(projectKeywordCategory.Id); Field projectField = CreateField("project"); Field imageField = CreateField("image"); Project project = CreateProject(projectKeyword, projectField); KeywordCategory keywordCategory = CreateKeywordCategory(projectCategory.Id); Keyword keyword = CreateKeyword(keywordCategory.Id); Photographer photographer = CreatePhotographer(); AccessLevel accessLevel = GetRandomAccessLevel(); CopyrightPolicy copyrightPolicy = CreateCopyrightPolicy(); CopyrightHolder copyrightHolder = CreateCopyrightHolder(copyrightPolicy.Id); File file = UploadFile(projectCategory, project, imageField, keyword, photographer, accessLevel, copyrightHolder); Album album = CreateAlbum(file); bool isHeroImage = AttachHeroImage(file, project); List <Search> searches = CreateSearches(file, keywordCategory, keyword, imageField, photographer, copyrightHolder, accessLevel, project, album); if (VerifySearches(searches, file)) { BaseNoun[] nouns; if (superUser) { nouns = new BaseNoun[] { file, photographer, copyrightHolder, copyrightPolicy, album, keyword, keywordCategory, imageField, projectField, projectKeyword, projectKeywordCategory, project }; } else { nouns = new BaseNoun[] { file, album, keyword, keywordCategory, imageField, projectField, projectKeyword, projectKeywordCategory, project }; } if (this.deleteObjects) { DeleteNouns(nouns); } } }
ProjectKeywordCategory ModifyProjectKeywordCategory(ProjectKeywordCategory item) { item.Name = "RESTClient Test ProjectKeywordCategory - PUT Test #" + Guid.NewGuid().ToString(); return(item); }