Exemplo n.º 1
0
        public async void DeleteFriend_ForProperGuids_ShouldDeleteFriendships()
        {
            var service     = new FriendService(_dataContext);
            var friendOneId = Guid.Parse("44889f11-b43e-476f-8cba-e9bbbf5d2b86");
            var friendTwoId = Guid.Parse("c47d5746-461f-461a-9f99-88e5dd725c1a");

            await service.DeleteFriend(friendOneId, friendTwoId);

            _dataContext.Friendships.FirstOrDefault(x => x.CurrentUserId == friendOneId && x.FriendId == friendTwoId).Should().BeNull();
            _dataContext.Friendships.FirstOrDefault(x => x.CurrentUserId == friendTwoId && x.FriendId == friendOneId).Should().BeNull();
        }
Exemplo n.º 2
0
 /// <summary>
 /// 删除联系人
 /// </summary>
 /// <param name="uid"></param>
 /// <param name="fid"></param>
 /// <returns></returns>
 public static int DeleteFriend(string uid, string ids)
 {
     return(FriendService.DeleteFriend(uid, ids));
 }