public void CSOMTokenReplacementService_Can_Replace_Site_Token() { var isValid = true; var runner = new CSOMProvisionRunner(); runner.SiteUrls.ForEach(siteUrl => { runner.WithCSOMContext(siteUrl, context => { PreloadProperties(context); var web = context.Web; if (web.ServerRelativeUrl == "/") { isValid &= CheckRootWebOnHost(context); } else { isValid &= CheckSubWebOnHost(context, web.ServerRelativeUrl); } }); }); Assert.IsTrue(isValid); }
public void CSOMTokenReplacementService_Should_Not_ChangeNonTokenedUrl() { var isValid = true; var runner = new CSOMProvisionRunner(); runner.SiteUrls.ForEach(siteUrl => { runner.WithCSOMContext(siteUrl, context => { PreloadProperties(context); var site = context.Site; var originalFullUrl = site.Url; var originalSiteRelativeUrl = site.ServerRelativeUrl; var originalValueResult = Service.ReplaceTokens(new TokenReplacementContext { Value = originalFullUrl, Context = context }); var originalSiteRelativeResult = Service.ReplaceTokens(new TokenReplacementContext { Value = originalSiteRelativeUrl, Context = context }); Assert.AreEqual(originalFullUrl, originalValueResult.Value); Assert.AreEqual(originalSiteRelativeUrl, originalSiteRelativeResult.Value); }); }); Assert.IsTrue(isValid); }
public void CSOMTokenReplacementService_Should_Support_ClientContext() { var runner = new CSOMProvisionRunner(); runner.SiteUrls.ForEach(siteUrl => { runner.WithCSOMContext(siteUrl, context => { PreloadProperties(context); var valueResult = Service.ReplaceTokens(new TokenReplacementContext { Value = "~site", Context = context }); }); }); }
public CSOMTokenReplacementServiceTests() { Service = new CSOMTokenReplacementService(); ProvisionRunner = new CSOMProvisionRunner(); }