public void OnlyReturnsPublicGroups() { var publicGroup = new Group() { AccessType = GroupAccess.Open, Description = "OpenGroup", Name = "OpenGroup" }; var secretGroup = new Group() { AccessType = GroupAccess.Secret, Description = "SecretGroup", Name = "SecretGroup" }; List<Group> result; using (var business = new SocialServiceBusiness(Data)) { business.Groups.AddGroup(publicGroup); business.Groups.AddGroup(secretGroup); result = business.Groups.GetGroups(); } Assert.AreEqual(1, result.Count); Assert.AreEqual(publicGroup, result.Single()); }
public void OnlyReturnsPublicGroups() { var publicGroup = new Group() { AccessType = GroupAccess.Open, Description = "OpenGroup", Name = "OpenGroup" }; var secretGroup = new Group() { AccessType = GroupAccess.Secret, Description = "SecretGroup", Name = "SecretGroup" }; List <Group> result; using (var business = new SocialServiceBusiness(Data)) { business.Groups.AddGroup(publicGroup); business.Groups.AddGroup(secretGroup); result = business.Groups.GetGroups(); } Assert.AreEqual(1, result.Count); Assert.AreEqual(publicGroup, result.Single()); }
public void DeleteMessage(Authentication auth, int messageId) { using (var business = new SocialServiceBusiness()) { business.Authentication.AuthenticateUser(auth); business.Groups.DeleteMessage(auth.UserId, messageId); } }
public List <Message> GetRelevantMessages(Authentication auth, int skip, int take) { using (var business = new SocialServiceBusiness()) { business.Authentication.AuthenticateUser(auth); return(business.Groups.GetRelevantMessages(auth.UserId, skip, take)); } }
public void PostMessage(Authentication auth, Message message, int?parentId) { using (var business = new SocialServiceBusiness()) { business.Authentication.AuthenticateUser(auth); business.Groups.PostMessage(message, parentId); } }
public List <Message> GetMessages(Authentication auth, int groupId) { using (var business = new SocialServiceBusiness()) { business.Authentication.AuthenticateUser(auth); return(business.Groups.GetMessages(auth.UserId, groupId)); } }
public void EnrollInGroup(Authentication auth, int groupId) { using (var business = new SocialServiceBusiness()) { business.Authentication.AuthenticateUser(auth); business.Groups.EnrollInGroup(auth.UserId, groupId); } }
public int AddGroup(Authentication auth, Group group) { using (var business = new SocialServiceBusiness()) { business.Authentication.AuthenticateUser(auth); return(business.Groups.AddGroup(group)); } }
public List <GroupExtended> GetGroupsExtended(Authentication auth) { using (var business = new SocialServiceBusiness()) { business.Authentication.AuthenticateUser(auth); return(business.Groups.GetGroupsExtended(auth.UserId)); } }
public Group GetGroup(Authentication auth, int groupId) { using (var business = new SocialServiceBusiness()) { business.Authentication.AuthenticateUser(auth); return(business.Groups.GetGroup(groupId)); } }
public Authentication Login(LoginCredentials credentials) { using (var business = new SocialServiceBusiness()) return(business.Authentication.Login(credentials)); }