Exemplo n.º 1
0
        public void NoInsigniasIfNoRewardBand()
        {
            var fakeBountyManager       = A.Fake <IBountyManager>();
            var fakeContributionManager = A.Fake <IContributionManager>();
            var fakeImpactMatrixManager = A.Fake <IImpactMatrixManager>();
            var fakeRewardManager       = A.Fake <RewardManager>();
            var fakeStaticWrapper       = A.Fake <IStaticWrapper>();

            var sampleRenownBandReward = new RewardPlayerKill
            {
                CrestCount = 1,
                CrestId    = 208431,
                Money      = 1500
            };
            // Bounty for the character being killed.
            var charBounty = new CharacterBounty
            {
                CharacterLevel = 1,
                RenownLevel    = 1,
                LastDeath      = 0
            };
            // Impacts upon the target character
            var fakeImpacts = new List <PlayerImpact>
            {
                new PlayerImpact {
                    CharacterId = 999, ExpiryTimestamp = 0, ImpactValue = 500, ModificationValue = 0.35f
                },
                new PlayerImpact {
                    CharacterId = 1000, ExpiryTimestamp = 0, ImpactValue = 5000, ModificationValue = 0.10f
                }
            };

            A.CallTo(() => fakeBountyManager.GetBounty(123, true)).Returns(charBounty);
            A.CallTo(() => fakeContributionManager.GetContributionValue(123)).Returns <short>(10);
            A.CallTo(() => fakeImpactMatrixManager.GetKillImpacts(123)).Returns(fakeImpacts);
            A.CallTo(() => fakeImpactMatrixManager.GetTotalImpact(123)).Returns(3350);

            A.CallTo(() => fakeStaticWrapper.GetRenownBandReward(1)).Returns(sampleRenownBandReward);

            var rm = new RewardManager(
                fakeContributionManager,
                fakeStaticWrapper, new List <RewardPlayerKill>
            {
                sampleRenownBandReward
            },
                (IImpactMatrixManager)fakeImpactMatrixManager);

            var insigniaRewards = rm.GetInsigniaRewards(100);

            Assert.IsTrue(insigniaRewards);
        }