コード例 #1
0
        public async Task AddFriendRequest_WhenCalled_AddFriendToRequestedByUserSentFriendRequestsList()
        {
            _currentUser.SentFriendRequests      = new List <Friend>();
            _currentUser.ReceievedFriendRequests = new List <Friend>();

            _userService.Setup(us => us.GetUserWithFriendsAsync(null)).ReturnsAsync(
                _currentUser
                );

            var service = new Mock <IFriendService>();

            await _friendService.AddFriendRequestAsync(_currentUser.Id, _otherUser1.Id);


            _userService.Verify(us => us.GetUserWithFriendsAsync(null));

            Assert.That(_currentUser.SentFriendRequests.Count, Is.EqualTo(1));
        }