public void Initialize() { TestCommon.FixAssemblyResolving("Newtonsoft.Json"); using (var ctx = TestCommon.CreateClientContext()) { admins = ctx.Web.GetAdministrators(); Web web = ctx.Web; ctx.Load(web, w => w.AssociatedOwnerGroup.Id, w => w.AssociatedMemberGroup.Id, w => w.AssociatedVisitorGroup.Id, w => w.Url); ctx.ExecuteQueryRetry(); originalAssociatedOwnerGroupId = web.AssociatedOwnerGroup.ServerObjectIsNull == true ? -1 : web.AssociatedOwnerGroup.Id; originalAssociatedMemberGroupId = web.AssociatedMemberGroup.ServerObjectIsNull == true ? -1 : web.AssociatedMemberGroup.Id; originalAssociatedVisitorGroupId = web.AssociatedVisitorGroup.ServerObjectIsNull == true ? -1 : web.AssociatedVisitorGroup.Id; originalIsNoScriptSite = web.IsNoScriptSite(); if (originalIsNoScriptSite) { AllowScripting(web.Url, true); } } }
public void Initialize() { _accessToken = TestCommon.AcquireTokenAsync("https://graph.microsoft.com"); TestCommon.FixAssemblyResolving("Newtonsoft.Json"); var random = new Random(); _groupId = UnifiedGroupsUtility.CreateUnifiedGroup("PnPDeletedUnifiedGroup test", "PnPDeletedUnifiedGroup test", $"pnp-unit-test-{random.Next(1, 1000)}", _accessToken, groupLogo: null).GroupId; UnifiedGroupsUtility.DeleteUnifiedGroup(_groupId, _accessToken); }
public virtual void Initialize() { TestCommon.FixAssemblyResolving("Newtonsoft.Json"); sitecollectionName = sitecollectionNamePrefix + Guid.NewGuid().ToString(); }