Ejemplo n.º 1
0
        public void TestMethod1()
        {
            for (var i = 0; i < 1000; i++)
            {
                var voterKey = makeRandomSigningKey();
                var vote     = "{President:'Dogbert'}";
                var ballot   = new Ballot();
                ballot.Id             = Guid.NewGuid();
                ballot.SubmissionDate = DateTime.UtcNow;
                ballot.BallotData     = vote;
                ballot.SignBallot(voterKey);
                ballot.SignSecret(voterKey, "this is a secret");
                ballot.LockBallotToChain(voterKey, ballots.Last().BallotHash);
                ballots.Add(ballot);
                voterKey.Dispose();
            }
            var validation = Ballot.BallotChainIsValid(ballots);

            Assert.IsTrue(validation.ChainValid);
        }