Пример #1
0
        public void ShouldGetFriends()
        {
            crudOnFriends.AddUserFriend(firstUsername, secondUsername).Wait();
            var friends = crudOnFriends.GetFriendsOfUser(firstUsername).Result;

            Assert.AreEqual(friends[0], secondUsername);
            crudOnFriends.DeleteFriendFromUser(firstUsername, secondUsername).Wait();
        }
Пример #2
0
        public async Task <IHttpActionResult> PostFriend(string username, string friend)
        {
            try
            {
                var newFriend = await crudOnFriends.AddUserFriend(username, friend);

                return(Ok(newFriend));
            }
            catch (Exception ex)
            {
                return(throwExceptionToUser.Throw(ex));
            }
        }