/// <summary> /// Update the observable collection of votes. /// </summary> private void UpdateVotesCollection() /// <param name="e">The <see cref="PropertyChangedEventArgs"/> instance containing the event data.</param> { var votesWithSupporters = VoteCounter.GetVotesCollection(VoteType.Vote); List <string> votes = votesWithSupporters.Keys .Concat(VoteCounter.GetCondensedRankVotes()) .Distinct(Agnostic.StringComparer).ToList(); AllVotesCollection.Replace(votes); OnPropertyChanged(nameof(AllVotesCollection)); }
public void ResetTest() { voteCounter.Reset(); Assert.AreEqual(0, voteCounter.GetVotersCollection(VoteType.Vote).Count); Assert.AreEqual(0, voteCounter.GetVotesCollection(VoteType.Vote).Count); Assert.AreEqual(0, voteCounter.GetVotersCollection(VoteType.Rank).Count); Assert.AreEqual(0, voteCounter.GetVotesCollection(VoteType.Rank).Count); Assert.AreEqual(0, voteCounter.ReferencePlanNames.Count); Assert.AreEqual(0, voteCounter.ReferencePlans.Count); Assert.AreEqual(0, voteCounter.ReferenceVoters.Count); Assert.AreEqual(0, voteCounter.ReferenceVoterPosts.Count); Assert.AreEqual(0, voteCounter.FutureReferences.Count); Assert.AreEqual(0, voteCounter.PlanNames.Count); Assert.AreEqual("", voteCounter.Title); }