Ejemplo n.º 1
0
        private void SetupEnergyData(uint energy, uint maxEnergy, DateTime lastTimeFull)
        {
            FashionMinigameServiceAPI.SetGameData
            (
                MockServerAccount,
                FashionEnergyManager.PLAYER_ENERGY_KEY,
                energy,
                SetResult
            );

            FashionMinigameServiceAPI.SetGameData
            (
                MockServerAccount,
                FashionEnergyManager.ENERGY_REGEN_DATE,
                lastTimeFull,
                SetResult
            );

            FashionMinigameServiceAPI.SetGameData
            (
                MockServerAccount,
                FashionEnergyManager.PLAYER_MAX_ENERGY,
                maxEnergy,
                SetResult
            );
        }
Ejemplo n.º 2
0
        public void FashionMinigameServiceAPIMockVerification()
        {
            bool callbackExecuted = false;

            FashionMinigameServiceAPI.SetGameData(mMockServerAccount, "Fairytales", "Goldielocks,Robin Hood,Cinderella", delegate(XmlDocument xml) { callbackExecuted = true; });
            FashionMinigameServiceAPI.SetGameData(mMockServerAccount, "Experience", "123456789", delegate(XmlDocument xml) { });
            Assert.IsTrue(callbackExecuted, "Something's wrong with the MockFashionSuite, the SetGameData callback isn't happening immediatedly");

            callbackExecuted = false;
            FashionMinigameServiceAPI.GetGameData(mMockServerAccount, new string[] { "Fairytales", "Experience", "KeyNotFoundEdgeCase" }, delegate(XmlDocument xml)
            {
                callbackExecuted = true;

                Assert.AreEqual("Robin Hood", xml.SelectSingleNode("//DataKey[@KeyName='Fairytales']").InnerText.Split(',')[1]);
                Assert.AreEqual(123456789, int.Parse(xml.SelectSingleNode("//DataKey[@KeyName='Experience']").InnerText));
            });
            Assert.IsTrue(callbackExecuted, "Something's wrong with the MockFashionSuite, the GetGameData callback isn't happening immediatedly");
        }
Ejemplo n.º 3
0
 public MockFashionSuite()
 {
     mCleanThisUp.Add(FashionMinigameServiceAPI.MockGetGameData(MockGetServerData));
     mCleanThisUp.Add(FashionMinigameServiceAPI.MockSetGameData(MockSetServerData));
 }