예제 #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);
        }
예제 #2
0
 private void DownloadPlayerStatProgression()
 {
     mBackend.GetTitleData(STATS_INFO_KEY, (result) => {
         mStatInfoData = JsonConvert.DeserializeObject <StatInfoData>(result);
     });
 }