コード例 #1
0
 private void TestGetNeighborsLeaderboard(Action <TestCaseResult> resultCallback)
 {
     eventSystemService.GetRankAndNeighbours(eventSystemService.GetCurrentEvents()[0].id)
     .Catch(e => resultCallback(TestCaseResult.Create(TestCaseResultCode.Failure, e.Message)))
     .Done(leaderboard => {
         string result = String.Format("{0}\n{1}:{2}\n{3}:{4}", "Got Neighbors leaderboard:", "Player Rank:", leaderboard.rank, "Leaderboard data:", leaderboard.leaderboardData.ArrayString());
         resultCallback(TestCaseResult.Create(TestCaseResultCode.Success, result));
     });
 }
コード例 #2
0
 private void TestShowRewardedAds(Action <TestCaseResult> resultCallback)
 {
     rewardedAds.ShowAd().Then(success => {
         if (success)
         {
             resultCallback(TestCaseResult.Create(TestCaseResultCode.Success, "Successfully shown"));
         }
         else
         {
             resultCallback(TestCaseResult.Create(TestCaseResultCode.Failure, "Failed to show"));
         }
     });
 }
コード例 #3
0
        private void OnTestClicked(TestCase test, GameObject go)
        {
            foreach (TestPrecondition preCondition in test.preconditions)
            {
                if (!preCondition.preCondition())
                {
                    HandleTestResult(TestCaseResult.Create(TestCaseResultCode.CannotArrange, preCondition.notMetDetails), test, go.GetComponent <TestCaseView> ());
                    return;
                }
            }

            test.Test(r => HandleTestResult(r, test, go.GetComponent <TestCaseView> ()));
        }
コード例 #4
0
        private void TestMoreApps(Action <TestCaseResult> resultCallback)
        {
            bool isMoreAppsAvailable = locationManager.IsReady(ApplicationLocation.MoreApps);

            if (isMoreAppsAvailable)
            {
                resultCallback(TestCaseResult.Create(TestCaseResultCode.Success, "More Apps Available"));
            }
            else
            {
                resultCallback(TestCaseResult.Create(TestCaseResultCode.Failure, "More Apps Unavailable"));
            }

            requestAppShelfSignal.Dispatch();
        }
コード例 #5
0
        private void TestShowInterstitial(Action <TestCaseResult> resultCallback)
        {
            interstitialDoneSignal.AddOnce(result => {
                if (result.success)
                {
                    resultCallback(TestCaseResult.Create(TestCaseResultCode.Success, "Successfully shown"));
                }
                else
                {
                    resultCallback(TestCaseResult.Create(TestCaseResultCode.Failure, "Failed to show"));
                }
            });

            requestInterstitialSignal.Dispatch(null);
        }
コード例 #6
0
        private void TestChargeEnergy(Action <TestCaseResult> resultCallback)
        {
            energySystemService.ChargeEnergy(1);

            resultCallback(TestCaseResult.Create(TestCaseResultCode.Success, "Success!"));
        }
コード例 #7
0
 private void TestHideBanners(Action <TestCaseResult> resultCallback)
 {
     bannerAds.Hide().Then(() =>
                           resultCallback(TestCaseResult.Create(TestCaseResultCode.Success, "Successfully shown")));
 }
コード例 #8
0
 private void TestGetCountryName(Action <TestCaseResult> resultCallback)
 {
     regionalService.GetCountryName()
     .Catch(e => resultCallback(TestCaseResult.Create(TestCaseResultCode.Failure, e.ToString())))
     .Done(name => resultCallback(TestCaseResult.Create(TestCaseResultCode.Success, "Country name:" + name)));
 }
コード例 #9
0
        private void TestAnyItemAvailableToBuy(Action <TestCaseResult> resultCallback)
        {
            bool anyItemAvailable = storeManager.AnyItemAvailableToBuy();

            resultCallback(TestCaseResult.Create(TestCaseResultCode.Inconclusive, anyItemAvailable.ToString()));
        }
コード例 #10
0
 private void TestShowAchievements(Action <TestCaseResult> resultCallback)
 {
     socialService.ShowAchievements();
     resultCallback(TestCaseResult.Create(TestCaseResultCode.Inconclusive, "Expecting user to see native UI popup"));
 }
コード例 #11
0
 private void TestConnectToSocial(Action <TestCaseResult> resultCallback)
 {
     socialService.Init();
     resultCallback(TestCaseResult.Create(TestCaseResultCode.Inconclusive, "Expecting user to see native UI notifying of connection"));
 }
コード例 #12
0
 private void TestRegisterToEvent(Action <TestCaseResult> resultCallback)
 {
     eventSystemService.RegisterToEvent(eventSystemService.GetAvailableEvents()[0].id)
     .Catch(e => resultCallback(TestCaseResult.Create(TestCaseResultCode.Failure, e.Message)))
     .Done(ev => resultCallback(TestCaseResult.Create(TestCaseResultCode.Success, ev.ToLogString())));
 }
コード例 #13
0
        private void TestFailingRequest(Action <TestCaseResult> resultCallback)
        {
            logger.Log("Dummy failing test");

            resultCallback(TestCaseResult.Create(TestCaseResultCode.Failure, "Failed"));
        }
コード例 #14
0
        private void TestSendRequest(Action <TestCaseResult> resultCallback)
        {
            logger.Log("Dummy test");

            resultCallback(TestCaseResult.Create(TestCaseResultCode.Success, "Success!"));
        }