internal void SiteCollectionContentTypeAdding(string url) { using (var cc = TestCommon.CreateClientContext(url)) { // Add supporting files, note that files validation will be done in the files test cases TestProvisioningTemplate(cc, "contenttype_files.xml", Handlers.Files | Handlers.Features); // Ensure we can test clean DeleteContentTypes(cc); // Add content types var result = TestProvisioningTemplate(cc, "contenttype_add.xml", Handlers.ContentTypes | Handlers.Fields); // Ensure the needed tokens are added to the target token parser, this is needed due to the tokenparser perf optimalizations result.TargetTokenParser.Tokens.Add(new SiteToken(cc.Web)); ContentTypeValidator cv = new ContentTypeValidator(cc.Web); Assert.IsTrue(cv.Validate(result.SourceTemplate.ContentTypes, result.TargetTemplate.ContentTypes, result.TargetTokenParser)); // change content types var result2 = TestProvisioningTemplate(cc, "contenttype_delta_1.xml", Handlers.ContentTypes); // Ensure the needed tokens are added to the target token parser, this is needed due to the tokenparser perf optimalizations result2.TargetTokenParser.Tokens.Add(new SiteToken(cc.Web)); Assert.IsTrue(cv.Validate(result2.SourceTemplate.ContentTypes, result2.TargetTemplate.ContentTypes, result2.TargetTokenParser)); } }
public void SiteCollectionContentTypeAddingTest() { using (var cc = TestCommon.CreateClientContext(centralSiteCollectionUrl)) { // Add supporting files, note that files validation will be done in the files test cases TestProvisioningTemplate(cc, "contenttype_files.xml", Handlers.Files); // Ensure we can test clean DeleteContentTypes(cc); // Add content types var result = TestProvisioningTemplate(cc, "contenttype_add.xml", Handlers.ContentTypes | Handlers.Fields); ContentTypeValidator cv = new ContentTypeValidator(cc.Web); Assert.IsTrue(cv.Validate(result.SourceTemplate.ContentTypes, result.TargetTemplate.ContentTypes, result.TargetTokenParser)); // change content types var result2 = TestProvisioningTemplate(cc, "contenttype_delta_1.xml", Handlers.ContentTypes); Assert.IsTrue(cv.Validate(result2.SourceTemplate.ContentTypes, result2.TargetTemplate.ContentTypes, result2.TargetTokenParser)); } }