Ejemplo n.º 1
0
    public static void MutalFriend()
    {
        Member a = new Member("A");
        Member b = new Member("B");
        Member c = new Member("C");
        Member d = new Member("D");

        a.AddFriend(b);
        a.AddFriend(c);
        c.AddFriend(d);
        b.AddFriend(d);

        Assert.AreSame(d, GetFriendsOfDegree(a, 2).Single());
        Assert.AreSame(d, GetFriendsOfDegree2(a, 2).Single());
    }
Ejemplo n.º 2
0
    public static void Main()
    {
        Member a = new Member("A");
        Member b = new Member("B");
        Member c = new Member("C");

        a.AddFriend(b);
        b.AddFriend(c);

        Assert.AreSame(c, GetFriendsOfDegree(a, 2).Single());
        Assert.AreSame(c, GetFriendsOfDegree2(a, 2).Single());
    }
Ejemplo n.º 3
0
 public static void AddFriend(this Member user, Member friend, Action onSuccess)
 {
     user.AddFriend(friend.Id, onSuccess);
 }