Example #1
0
        public void GetNameKey_ReturnsAsExpected()
        {
            IGameRewardData mockData = Substitute.For <IGameRewardData>();

            mockData.GetId().Returns("FakeID");

            DungeonReward systemUnderTest = new DungeonReward(MockPlayerData, mockData);

            Assert.AreEqual("FakeID" + DungeonReward.NAME_KEY, systemUnderTest.GetNameKey());
        }
Example #2
0
        public void BasicValues_EqualDataValues()
        {
            IGameRewardData mockData = Substitute.For <IGameRewardData>();

            mockData.GetCount().Returns(100);
            mockData.GetId().Returns("FakeID");
            mockData.GetLootType().Returns("Gold");

            DungeonReward systemUnderTest = new DungeonReward(MockPlayerData, mockData);

            Assert.AreEqual(100, systemUnderTest.GetCount());
            Assert.AreEqual("FakeID", systemUnderTest.GetId());
            Assert.AreEqual(LootTypes.Gold, systemUnderTest.GetLootType());
        }
Example #3
0
        public void WhenAwardingGold_CountIsAddedToPlayerGold()
        {
            MockPlayerData.Gold = 0;
            IGameRewardData mockData = Substitute.For <IGameRewardData>();

            mockData.GetCount().Returns(101);
            mockData.GetLootType().Returns("Gold");


            DungeonReward systemUnderTest = new DungeonReward(MockPlayerData, mockData);

            systemUnderTest.Award();

            Assert.AreEqual(101, MockPlayerData.Gold);
        }