public void ComplexContributionNoMax() { var contributionList = new List <PlayerContribution>(); var contributionManager = new ContributionManager(new ConcurrentDictionary <uint, List <PlayerContribution> >(), ContributionFactorReferenceList); contributionList.Add(new PlayerContribution { ContributionId = 1, Timestamp = 1111 }); contributionList.Add(new PlayerContribution { ContributionId = 1, Timestamp = 1111 }); contributionList.Add(new PlayerContribution { ContributionId = 1, Timestamp = 1111 }); contributionList.Add(new PlayerContribution { ContributionId = 1, Timestamp = 1111 }); contributionList.Add(new PlayerContribution { ContributionId = 1, Timestamp = 1111 }); contributionList.Add(new PlayerContribution { ContributionId = 1, Timestamp = 1111 }); contributionList.Add(new PlayerContribution { ContributionId = 1, Timestamp = 1111 }); contributionList.Add(new PlayerContribution { ContributionId = 2, Timestamp = 1111 }); contributionList.Add(new PlayerContribution { ContributionId = 2, Timestamp = 1111 }); contributionList.Add(new PlayerContribution { ContributionId = 2, Timestamp = 1111 }); var response = contributionManager.GetContributionStageDictionary(contributionList, ContributionFactorReferenceList); Assert.IsTrue(response[1].ContributionStageCount == 7); Assert.IsTrue(response[0].ContributionStageCount == 0); Assert.IsTrue(response[2].ContributionStageCount == 3); Assert.IsTrue(response[1].ContributionStageSum == 7); Assert.IsTrue(response[0].ContributionStageSum == 0); Assert.IsTrue(response[2].ContributionStageSum == 9); }
public void NoPlayerContributionReturnsPreparedStructure() { var contributionList = new List <World.Battlefronts.Bounty.PlayerContribution>(); var contributionManager = new ContributionManager(new ConcurrentDictionary <uint, List <World.Battlefronts.Bounty.PlayerContribution> >(), ContributionFactorReferenceList); var result = contributionManager.GetContributionStageDictionary(contributionList, ContributionFactorReferenceList); Assert.IsTrue(result.Count == ContributionFactorReferenceList.Count); Assert.IsTrue(result[0].ContributionStageSum == 0); Assert.IsTrue(result[1].ContributionStageSum == 0); Assert.IsTrue(result[2].ContributionStageSum == 0); Assert.IsTrue(result[0].ContributionStageCount == 0); Assert.IsTrue(result[1].ContributionStageCount == 0); Assert.IsTrue(result[2].ContributionStageCount == 0); Assert.IsTrue(result[0].ContributionStageMax == ContributionFactorReferenceList[0].MaxContributionCount); Assert.IsTrue(result[1].ContributionStageMax == ContributionFactorReferenceList[1].MaxContributionCount); Assert.IsTrue(result[2].ContributionStageMax == ContributionFactorReferenceList[2].MaxContributionCount); }