public async Task AllForChannel_Should_Return_Users_That_Are_Members() { using (var context = new WarblerDbContext(Options)) { var repo = new SqlMembershipRepository(context); var generalMemberships = await repo.AllFor(General).ToList(); // General only had one member added (Bob) Assert.AreEqual(1, generalMemberships.Count); Assert.IsTrue(generalMemberships.Single().User.UserName == "Bob"); } }
public async Task AllForUser_Should_Return_Channels_Where_User_Is_Member() { using (var context = new WarblerDbContext(Options)) { var repo = new SqlMembershipRepository(context); var bobMemberships = await repo.AllFor(Bob).ToList(); // Bob was only added to one channel (#general) Assert.AreEqual(1, bobMemberships.Count); Assert.IsTrue(bobMemberships.Single().Channel.Name == "general"); } }