public async Task ThrowOnVisibilityModification() { CSEntryChange cs = CSEntryChange.Create(); cs.ObjectType = "team"; cs.ObjectModificationType = ObjectModificationType.Update; cs.AnchorAttributes.Add(AnchorAttribute.Create("id", "1234")); cs.CreateAttributeAdd("visibility", "Public"); try { await teamExportProvider.PutCSEntryChangeAsync(cs); Assert.Fail("The expected exception was not thrown"); } catch (InitialFlowAttributeModificationException) { } }
public async Task ThrowOnDisplayNameDelete() { CSEntryChange cs = CSEntryChange.Create(); cs.ObjectType = "team"; cs.ObjectModificationType = ObjectModificationType.Update; cs.AnchorAttributes.Add(AnchorAttribute.Create("id", "1234")); cs.CreateAttributeDelete("displayName"); try { await teamExportProvider.PutCSEntryChangeAsync(cs); Assert.Fail("The expected exception was not thrown"); } catch (UnsupportedAttributeDeleteException) { } }
private static async Task <string> CreateTeamWithMembers(int memberCount, int ownerCount) { CSEntryChange team = CSEntryChange.Create(); team.ObjectType = "team"; team.ObjectModificationType = ObjectModificationType.Add; team.CreateAttributeAdd("displayName", "mytestteam"); team.CreateAttributeAdd("member", UnitTestControl.Users.Take(memberCount).Select(t => t.Id).ToList <object>()); team.CreateAttributeAdd("owner", UnitTestControl.Users.GetRange(memberCount, ownerCount).Select(t => t.Id).ToList <object>()); CSEntryChangeResult teamResult = await teamExportProvider.PutCSEntryChangeAsync(team); AddTeamToCleanupTask(teamResult); Assert.IsTrue(teamResult.ErrorCode == MAExportError.Success); return(teamResult.GetAnchorValueOrDefault <string>("id")); }