public void AddAccessMember(ITable table, TaskContext context) { table.Dispatcher.Invoke(() => { var userContext = table.GetService(typeof(IUserContext)) as IUserContext; var memberID = userContext.Dispatcher.Invoke(() => userContext.Select(item => item.Path).Random()); var accessType = RandomUtility.NextEnum <AccessType>(); table.AddAccessMember(context.Authentication, memberID, accessType); }); }
public static void AddAccessMemberFailTest <T>(ITable table, Authentication authentication, string memberID) where T : Exception { Assert.AreNotEqual(null, table.Parent); table.Dispatcher.Invoke(() => { try { table.AddAccessMember(authentication, memberID, AccessType.ReadWrite); Assert.Fail("AddAccessMember"); } catch (T) { } }); }
public void AddAccessMember() { table.AddAccessMember(authentication, "admin", ServiceModel.AccessType.Owner); }