Example #1
0
 public void AddVoteParamsTest1()
 {
     voteCounter.AddVotes(null, null, null, VoteType.Vote);
 }
        public void Simple_Reference()
        {
            quest.PartitionMode     = PartitionMode.ByLine;
            quest.DisableProxyVotes = false;
            voteCounter.Quest       = quest;

            string voteText1 = oneLine;
            string voteText2 = refKinematics;
            Post   post1     = GetPostFromKinematics1(voteText1);
            Post   post2     = GetPostFromAtreya(voteText2);

            List <Post> posts = new List <Post>()
            {
                post1, post2
            };

            voteCounter.AddPosts(posts);
            voteCounter.AddReferenceVoter(post1.Origin);
            voteCounter.AddReferenceVoter(post2.Origin);

            var results1 = voteConstructor.ProcessPostGetVotes(post1, quest);

            if (results1 != null)
            {
                voteCounter.AddVotes(results1, post1.Origin);

                var results2 = voteConstructor.ProcessPostGetVotes(post2, quest);

                if (results2 != null)
                {
                    Assert.IsTrue(results1[0].Lines[0] == results2[0].Lines[0]);

                    voteCounter.AddVotes(results2, post2.Origin);

                    Assert.AreEqual(2, voteCounter.VoteStorage.GetSupportCountFor(results1[0]));
                }

                Assert.IsFalse(results2 == null);
            }

            Assert.IsFalse(results1 == null);
        }