示例#1
0
        public void FindVotesForVoterTest1()
        {
            string        voteLine1 = "[x] Vote for stuff 1";
            string        voteLine2 = "[x] Vote for stuff 2";
            string        voter1    = "me";
            string        voter2    = "you";
            string        postId1   = "1";
            string        postId2   = "2";
            List <string> vote1     = new List <string> {
                voteLine1
            };
            List <string> vote2 = new List <string> {
                voteLine2
            };
            VoteType voteType = VoteType.Vote;

            voteCounter.AddVotes(vote1, voter1, postId1, voteType);
            voteCounter.AddVotes(vote2, voter2, postId2, voteType);
            voteCounter.ReferenceVoters.Add(voter1);
            voteCounter.ReferenceVoters.Add(voter2);

            var votes = voteCounter.GetVotesFromReference("[x] me", "Him");

            Assert.AreEqual(1, votes.Count);
            Assert.IsTrue(votes.Contains(voteLine1));
        }