protected override IEnumerator runTest()
    {
        while (!bobSession.LocalUser.IncomingFriendInvitations.Any())
        {
            yield return(null);
        }
        IAcceptFriendInvitationResult rejectResult = null;

        bobSession.LocalUser.AcceptFriendInvitation(bobSession.LocalUser.IncomingFriendInvitations.First(), acceptTrust : false, delegate(IAcceptFriendInvitationResult r)
        {
            rejectResult = r;
        });
        while (rejectResult == null)
        {
            yield return(null);
        }
        IntegrationTestEx.FailIf(!rejectResult.Success, "Accept friend invitation failed");
        while (dataEntityCollection.FindEntity <DisplayNameData, string>(bobSession.LocalUser.DisplayName.Text).IsNull)
        {
            yield return(null);
        }
        DataEntityHandle handle = dataEntityCollection.FindEntity <DisplayNameData, string>(bobSession.LocalUser.DisplayName.Text);

        while (dataEntityCollection.GetComponent <OutgoingFriendInvitationData>(handle) != null)
        {
            yield return(null);
        }
        while (dataEntityCollection.GetComponent <FriendData>(handle) == null)
        {
            yield return(null);
        }
    }
Beispiel #2
0
        protected override IEnumerator runTest()
        {
            while (!bobSession.LocalUser.IncomingFriendInvitations.Any())
            {
                yield return(null);
            }
            string bobNewDisplayName = BaseFriendsIntegrationTest.CreateRandomName();
            IUpdateDisplayNameResult updateDisplayNameResult = null;

            bobSession.LocalUser.UpdateDisplayName(bobNewDisplayName, delegate(IUpdateDisplayNameResult r)
            {
                updateDisplayNameResult = r;
            });
            while (updateDisplayNameResult == null)
            {
                yield return(null);
            }
            IntegrationTestEx.FailIf(!updateDisplayNameResult.Success, "Failed to change Bob's display name to " + bobNewDisplayName);
            IAcceptFriendInvitationResult acceptResult = null;

            bobSession.LocalUser.AcceptFriendInvitation(bobSession.LocalUser.IncomingFriendInvitations.First(), acceptTrust : false, delegate(IAcceptFriendInvitationResult r)
            {
                acceptResult = r;
            });
            while (acceptResult == null)
            {
                yield return(null);
            }
            IntegrationTestEx.FailIf(!acceptResult.Success, "Accept friend invitation failed");
            while (dataEntityCollection.GetEntityByType <FriendData>().IsNull)
            {
                yield return(null);
            }
            DataEntityHandle inviteeFriend          = dataEntityCollection.GetEntityByType <FriendData>();
            FriendData       inviteeFriendData      = dataEntityCollection.GetComponent <FriendData>(inviteeFriend);
            DisplayNameData  inviteeDisplayNameData = dataEntityCollection.GetComponent <DisplayNameData>(inviteeFriend);

            IntegrationTestEx.FailIf(inviteeFriendData.Friend.DisplayName.Text != bobNewDisplayName, $"The invitee friend data display name did not match changed display name 1. Actual: {inviteeFriendData.Friend.DisplayName.Text}. Expected: {bobNewDisplayName}");
            IntegrationTestEx.FailIf(inviteeDisplayNameData.DisplayName != bobNewDisplayName, $"The invitee display name data display name did not match changed display name 1. Actual: {inviteeDisplayNameData.DisplayName}. Expected: {bobNewDisplayName}");
        }
Beispiel #3
0
        protected override IEnumerator setup()
        {
            yield return(base.setup());

            friendsService.FindUser(bobSession.LocalUser.DisplayName.Text, aliceSession.LocalUser);
            while (dataEntityCollection.GetEntityByType <SearchedUserData>().IsNull)
            {
                yield return(null);
            }
            DataEntityHandle searchedUserHandle = dataEntityCollection.GetEntityByType <SearchedUserData>();
            SearchedUserData searchedUserData   = dataEntityCollection.GetComponent <SearchedUserData>(searchedUserHandle);

            friendsService.SendFriendInvitation(searchedUserData.SearchedUser, aliceSession.LocalUser);
            while (dataEntityCollection.GetEntityByType <OutgoingFriendInvitationData>().IsNull)
            {
                yield return(null);
            }
            while (!bobSession.LocalUser.IncomingFriendInvitations.Any())
            {
                yield return(null);
            }
            IAcceptFriendInvitationResult rejectResult = null;

            bobSession.LocalUser.AcceptFriendInvitation(bobSession.LocalUser.IncomingFriendInvitations.First(), acceptTrust : false, delegate(IAcceptFriendInvitationResult r)
            {
                rejectResult = r;
            });
            while (rejectResult == null)
            {
                yield return(null);
            }
            IntegrationTestEx.FailIf(!rejectResult.Success, "Accept friend invitation failed");
            while (dataEntityCollection.GetEntityByType <FriendData>().IsNull)
            {
                yield return(null);
            }
        }
Beispiel #4
0
 private void onAcceptFriendInvitationSent(IAcceptFriendInvitationResult result, string friendName)
 {
     Service.Get <EventDispatcher>().DispatchEvent(new FriendsServiceEvents.AcceptFriendInvitationSent(result.Success, friendName));
 }