Exemplo n.º 1
0
        public async Task GetSuggestedFriends_UserHasNoFriends_ReturnAllUsers()
        {
            _userService.Setup(us => us.GetAllUsersExceptCurrentUser()).ReturnsAsync(new List <User>
            {
                _otherUser1,
                _otherUser2,
            }.AsQueryable());

            _userService.Setup(us => us.GetUserWithFriendsAsync(null)).ReturnsAsync(new User
            {
                ReceievedFriendRequests = new List <Friend>(),
                SentFriendRequests      = new List <Friend>()
            });

            var result = await _friendService.GetSuggestedFriendsAsync();

            Assert.That(result, Is.EquivalentTo(new List <User>
            {
                _otherUser1,
                _otherUser2
            }));

            Assert.That(result.Count(), Is.EqualTo(2));
        }