コード例 #1
0
        public virtual void TestInitialise()
        {
            _context = new TestVotingContext();

            // Open, Anonymous, No Choice Adding, Shown Results
            _defaultPoll = new Poll()
            {
                UUID           = PollGuid,
                ManageId       = PollManageGuid,
                PollType       = PollType.Basic,
                Name           = "Test Poll",
                LastUpdatedUtc = DateTime.UtcNow,
                CreatedDateUtc = DateTime.UtcNow,
                Choices        = new List <Choice>(),
                InviteOnly     = false,
                NamedVoting    = false,
                ChoiceAdding   = false
            };

            _context.Polls.Add(_defaultPoll);
            _context.SaveChanges();

            _driver = new NgWebDriver(new ChromeDriver(ChromeDriverDir));
            _driver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(10));
            _driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(10));
        }
コード例 #2
0
ファイル: Clearer.cs プロジェクト: aruslanovna/ComeTogether
 public Clearer(ITestVotingContext context)
 {
     _context = context;
 }
コード例 #3
0
        public virtual void TestInitialise()
        {
            _context = new TestVotingContext();

            // Open, Anonymous, No Choice Adding, Shown Results
            _defaultPoll = new Poll()
            {
                UUID           = PollGuid,
                ManageId       = PollManageGuid,
                PollType       = PollType.Basic,
                Name           = "Test Poll",
                LastUpdatedUtc = DateTime.UtcNow,
                CreatedDateUtc = DateTime.UtcNow,
                Choices        = new List <Choice>(),
                InviteOnly     = false,
                NamedVoting    = false,
                ChoiceAdding   = false,
                MaxPerVote     = 3,
                MaxPoints      = 4,
                Ballots        = new List <Ballot>()
            };

            Choice testChoice = new Choice()
            {
                Name = "Test", PollChoiceNumber = 1
            };

            _defaultPoll.Choices.Add(testChoice);

            Ballot ballot1 = new Ballot()
            {
                TokenGuid  = Guid.NewGuid(),
                ManageGuid = Guid.NewGuid(),
                VoterName  = "Voter 1",
                Votes      = new List <Vote>()
            };

            Ballot ballot2 = new Ballot()
            {
                TokenGuid  = Guid.NewGuid(),
                ManageGuid = Guid.NewGuid(),
                VoterName  = "Voter 2",
                Votes      = new List <Vote>()
            };

            ballot1.Votes.Add(new Vote()
            {
                Choice    = testChoice,
                Ballot    = ballot1,
                VoteValue = 1
            });

            ballot2.Votes.Add(new Vote()
            {
                Choice    = testChoice,
                Ballot    = ballot2,
                VoteValue = 1
            });

            _defaultPoll.Ballots.Add(ballot1);
            _defaultPoll.Ballots.Add(ballot2);

            _context.Polls.Add(_defaultPoll);
            _context.SaveChanges();

            _driver = new NgWebDriver(new ChromeDriver(ChromeDriverDir));
            _driver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(10));
            _driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(10));
        }
コード例 #4
0
ファイル: DBClearer.cs プロジェクト: aruslanovna/ComeTogether
 public DBClearer(ITestVotingContext context) : base(context)
 {
 }