Пример #1
0
        private IEnumerator stopAll_VerifyDidStop()
        {
            CoroutineOwnerMap <RadicalCoroutine> map = new CoroutineOwnerMap <RadicalCoroutine>();
            bool       testerDidFinish = false;
            bool       testerDidCancel = false;
            ICoroutine coroutine       = CoroutineRunner.Start(testerCoroutine(), this, "testerCoroutine");

            coroutine.ECompleted += delegate
            {
                testerDidFinish = true;
            };
            coroutine.ECancelled += delegate
            {
                testerDidCancel = true;
            };
            map.Add(this, (RadicalCoroutine)coroutine);
            IntegrationTestEx.FailIf(map.GetCountForOwner(this) != 1);
            map.StopAll();
            yield return(coroutine);

            IntegrationTestEx.FailIf(testerDidCancel);
            IntegrationTestEx.FailIf(testerDidFinish);
            IntegrationTestEx.FailIf(!coroutine.Disposed);
            IntegrationTestEx.FailIf(map.GetCountForOwner(this) != 0);
        }
        private IEnumerator waitForNestedIEnumeratorTest()
        {
            frameCount = 0;
            yield return(RadicalCoroutine.Run(this, parentCoroutine(parentCoroutine(new CompositeCoroutineReturn(new WaitForFrame(4)))), "testCoroutine"));

            IntegrationTestEx.FailIf(frameCount != 4, "waitForNestedIEnumeratorTest waited for the incorrect number of frames");
        }
Пример #3
0
        protected override IEnumerator runTest()
        {
            while (dataEntityCollection.GetEntityByType <IncomingFriendInvitationData>().IsNull)
            {
                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);
            friendsService.AcceptFriendInvitation(aliceSession.LocalUser.IncomingFriendInvitations.First(), aliceSession.LocalUser);
            while (dataEntityCollection.GetEntityByType <FriendData>().IsNull)
            {
                yield return(null);
            }
            DataEntityHandle aliceFriendHandle    = dataEntityCollection.GetEntityByType <FriendData>();
            FriendData       aliceFriendData      = dataEntityCollection.GetComponent <FriendData>(aliceFriendHandle);
            DisplayNameData  aliceDisplayNameData = dataEntityCollection.GetComponent <DisplayNameData>(aliceFriendHandle);

            IntegrationTestEx.FailIf(aliceFriendData.Friend.DisplayName.Text != bobNewDisplayName, $"The invitee friend data display name did not match changed display name 1. Actual: {aliceFriendData.Friend.DisplayName.Text}. Expected: {bobNewDisplayName}");
            IntegrationTestEx.FailIf(aliceDisplayNameData.DisplayName != bobNewDisplayName, $"The invitee display name data display name did not match changed display name 1. Actual: {aliceDisplayNameData.DisplayName}. Expected: {bobNewDisplayName}");
        }
Пример #4
0
        protected override IEnumerator setup()
        {
            yield return(base.setup());

            IFindUserResult findUserResult = null;

            bobSession.LocalUser.FindUser(aliceSession.LocalUser.DisplayName.Text, delegate(IFindUserResult r)
            {
                findUserResult = r;
            });
            while (findUserResult == null)
            {
                yield return(null);
            }
            IntegrationTestEx.FailIf(!findUserResult.Success, "Find user failed");
            ISendFriendInvitationResult sendInviteResult = null;

            bobSession.LocalUser.SendFriendInvitation(findUserResult.User, requestTrust : false, delegate(ISendFriendInvitationResult r)
            {
                sendInviteResult = r;
            });
            while (sendInviteResult == null)
            {
                yield return(null);
            }
            IntegrationTestEx.FailIf(!sendInviteResult.Success, "Send friend invitation failed");
        }
Пример #5
0
        protected override IEnumerator runTest()
        {
            string payload = "test/test_cube?dl=www-bundle&x=txt";

            ContentManifest.AssetEntry entry            = ContentManifest.AssetEntry.Parse(payload);
            DeviceManager         deviceManager         = new DeviceManager();
            GcsAccessTokenService gcsAccessTokenService = new GcsAccessTokenService(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountName"), new GcsP12AssetFileLoader(ConfigHelper.GetEnvironmentProperty <string>("GcsServiceAccountFile")));
            CPipeManifestService  cpipeManifestService  = new CPipeManifestService("https://storage.googleapis.com/ad37ed76-3a24-91ba-def6-2ff16973c49d.disney.io/", "__mapping_cpremix_dev.json", gcsAccessTokenService);

            deviceManager.Mount(new WwwBundleDevice(deviceManager, gcsAccessTokenService, cpipeManifestService));
            AssetRequest <AssetBundle> request = deviceManager.LoadAsync <AssetBundle>(entry.DeviceList, ref entry);

            IntegrationTestEx.FailIf(request == null);
            IntegrationTestEx.FailIf(request.Finished);
            IntegrationTestEx.FailIf(request.Cancelled);
            yield return(request);

            IntegrationTest.Assert(request.Finished);
            IntegrationTest.Assert(!request.Cancelled);
            IntegrationTest.Assert(request.Asset != null);
            IntegrationTest.Assert(request.Asset.GetAllAssetNames().Length == 1);
            string[] assetNames = request.Asset.GetAllAssetNames();
            IntegrationTest.Assert(assetNames.Contains("assets/bundleassets/test/test_cube.prefab"));
            request.Asset.Unload(unloadAllLoadedObjects: false);
        }
Пример #6
0
        private IEnumerator isFinishedEmpty_VerifyTrue()
        {
            CoroutineGroup coroutineGroup = new CoroutineGroup();

            IntegrationTestEx.FailIf(!coroutineGroup.IsFinished);
            yield break;
        }
Пример #7
0
        private IEnumerator isFinished_VerifyFalse()
        {
            CoroutineGroup coroutineGroup = new CoroutineGroup();

            coroutineGroup.StartAndAdd(testerCoroutine(), this, "testerCoroutineEmptyEnumator");
            IntegrationTestEx.FailIf(coroutineGroup.IsFinished);
            yield break;
        }
Пример #8
0
        private IEnumerator isFinished_VerifyTrue()
        {
            CoroutineGroup group = new CoroutineGroup();

            yield return(group.StartAndAdd(testerCoroutine(), this, "testerCoroutineEmptyEnumator"));

            IntegrationTestEx.FailIf(!group.IsFinished);
        }
        private void updateComplete()
        {
            ErrorsMap errorsMap = Service.Get <ErrorsMap>();

            errorsMap.EUpdateComplete = (System.Action)Delegate.Remove(errorsMap.EUpdateComplete, new System.Action(updateComplete));
            IntegrationTestEx.FailIf(Service.Get <ErrorsMap>() == null);
            IntegrationTestEx.FailIf(!Service.Get <ErrorsMap>().IsValidError("100"));
            IntegrationTest.Pass();
        }
Пример #10
0
        private IEnumerator waitForCompositeReturnTest()
        {
            yield return(new CompositeCoroutineReturn(new WaitForFrame(2), new WaitForFrame(3)));

            if (frameCount != 3)
            {
                IntegrationTest.Fail("WaitForFrame (x2) waited for the incorrect number of frames.");
            }
            IntegrationTestEx.FailIf(frameCount != 3, "WaitForFrame (x2) waited for the incorrect number of frames.");
        }
Пример #11
0
        protected override IEnumerator runTest()
        {
            AssetRequest <GameObject> request = Content.LoadAsync <GameObject>("test/test_cube");

            IntegrationTestEx.FailIf(request == null);
            yield return(request);

            IntegrationTest.Assert(request.Finished);
            IntegrationTest.Assert(!request.Cancelled);
            IntegrationTest.Assert(request.Asset != null);
            IntegrationTest.Assert(request.Asset.GetType() == typeof(GameObject));
        }
Пример #12
0
        private IEnumerator add_VerifyDoesContain()
        {
            CoroutineOwnerMap <RadicalCoroutine> map = new CoroutineOwnerMap <RadicalCoroutine>();
            ICoroutine coroutine = CoroutineRunner.Start(testerCoroutine(), this, "testerCoroutine");

            IntegrationTestEx.FailIf(map.GetCountForOwner(this) != 0);
            map.Add(this, (RadicalCoroutine)coroutine);
            IntegrationTestEx.FailIf(map.GetCountForOwner(this) != 1);
            map.Add(this, (RadicalCoroutine)coroutine);
            IntegrationTestEx.FailIf(map.GetCountForOwner(this) != 1);
            yield return(coroutine);
        }
Пример #13
0
        protected override IEnumerator runTest()
        {
            string           testEntity1 = "TestEntity1";
            DataEntityHandle handle      = dataEntityCollection.AddEntity(testEntity1);

            dataEntityCollection.RemoveEntityByName(testEntity1);
            IntegrationTestEx.FailIf(!handle.IsNull, "DataEntityHandle is still valid");
            GC.Collect();
            yield return(null);

            Debug.Log("-*-*-*-*-*-*-*-* Hello there -*-*-*-*-*-*-*");
            IntegrationTestEx.FailIf(!handle.IsNull, "DataEntityHandle is still valid");
        }
Пример #14
0
        private IEnumerator waitForCompletedEventTest()
        {
            bool             completed = false;
            RadicalCoroutine coroutine = RadicalCoroutine.Create(testCoroutine(), "testCoroutine");

            coroutine.ECompleted += delegate
            {
                completed = true;
            };
            StartCoroutine(coroutine.Enumerator);
            yield return(coroutine);

            IntegrationTestEx.FailIf(!completed, "coroutine did not dispatch ECompleted after completion.");
            IntegrationTestEx.FailIf(coroutine.Cancelled);
        }