public async Task Waiting_passes_RequestConfirmed_to_ViewBag(bool RequestConfirmed) { var userId = "foxyboots9-guid"; var mockDbContext = new MockContext(); var controller = new FriendshipsController(mockDbContext.Object, () => userId); var result = await controller.Waiting(RequestConfirmed) as ViewResult; Assert.IsNotNull(result); Assert.AreEqual(RequestConfirmed, result.ViewBag.RequestConfirmed); }
public async Task Waiting_returns_Friendships_waiting_for_approval() { var userId = "foxyboots9-guid"; var mockDbContext = new MockContext(); var controller = new FriendshipsController(mockDbContext.Object, () => userId); var result = await controller.Waiting() as ViewResult; Assert.IsNotNull(result); var model = result.Model as IEnumerable <FriendshipWithNames>; Assert.IsNotNull(model); foreach (var friendship in model) { Assert.That(friendship.FriendId == userId && !friendship.RequestApproved.HasValue); } }