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));
     });
 }
 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> ()));
        }
        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();
        }
        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);
        }
        private void TestChargeEnergy(Action <TestCaseResult> resultCallback)
        {
            energySystemService.ChargeEnergy(1);

            resultCallback(TestCaseResult.Create(TestCaseResultCode.Success, "Success!"));
        }
 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)));
 }
        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"));
 }
 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!"));
        }