public void ShouldGetFriends() { crudOnFriends.AddUserFriend(firstUsername, secondUsername).Wait(); var friends = crudOnFriends.GetFriendsOfUser(firstUsername).Result; Assert.AreEqual(friends[0], secondUsername); crudOnFriends.DeleteFriendFromUser(firstUsername, secondUsername).Wait(); }
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)); } }