示例#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);
        }
        public int GetStat(string i_key)
        {
            int stat = (int)Math.Ceiling(mStatData.GetStatLevel(i_key) * mStatInfoData.GetValuePerLevel(i_key));

            return(stat);
        }