Пример #1
0
        public async Task TestDeleteTextPoll(string title, params string[] answers)
        {
            Poll poll;

            // Create poll
            using (var service = Statics.NewService())
            {
                var textAnswers = answers.Select(a => new TextAnswer(a));
                poll = await service.CreatePollAsync(CurrentUser, title, DateTime.Now.AddDays(10), textAnswers);

                IList <Answer> pollAnwers;
                pollAnwers = await service.GetAnswersForPollAsync(poll);

                foreach (var answer in pollAnwers)
                {
                    await service.DeleteAnswerAsync(answer);
                }

                await service.DeletePollAsync(poll);

                await service.SaveAsync();
            }
        }
Пример #2
0
        public async Task TestVotes(string title, params string[] answers)
        {
            IList <DoodlerCore.Vote> vote;
            Poll poll;

            // Create poll
            using (var service = Statics.NewService())
            {
                var textAnswers = answers.Select(answer => new TextAnswer(answer));
                poll = await service.CreatePollAsync(CurrentUser, title, DateTime.Now.AddDays(10), textAnswers);

                await service.SaveAsync();
            }



            //Checking Votes
            using (var service = Statics.NewService())
            {
                vote = await service.GetVotesForPollAsync(poll);
            }
            Assert.NotEmpty(vote);
        }
Пример #3
0
 public DeleteVoteTests()
 {
     CurrentUser = Statics.LoginUser().GetAwaiter().GetResult();
 }
Пример #4
0
 public PollTests()
 {
     CurrentUser = Statics.LoginUser().GetAwaiter().GetResult();
 }
Пример #5
0
 public TestDeletePoll()
 {
     CurrentUser = Statics.LoginUser().GetAwaiter().GetResult();
 }