Exemple #1
0
        public void GetStat_ReturnsExpected(int i_playerStatLevel, float i_statValuePerLevel, int i_expectedResult)
        {
            IPlayerStatData mockPlayerStats = Substitute.For <IPlayerStatData>();

            mockPlayerStats.GetStatLevel(Arg.Any <string>()).Returns(i_playerStatLevel);

            IStatInfoData mockStatInfo = Substitute.For <IStatInfoData>();

            mockStatInfo.GetValuePerLevel(Arg.Any <string>()).Returns(i_statValuePerLevel);

            systemUnderTest.PlayerStatData = mockPlayerStats;
            systemUnderTest.StatInfoData   = mockStatInfo;

            int statValue = systemUnderTest.GetStat("AnyStat");

            Assert.AreEqual(i_expectedResult, statValue);
        }
 private void DownloadPlayerStatProgression()
 {
     mBackend.GetTitleData(STATS_INFO_KEY, (result) => {
         mStatInfoData = JsonConvert.DeserializeObject <StatInfoData>(result);
     });
 }