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(); } }
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); }
public DeleteVoteTests() { CurrentUser = Statics.LoginUser().GetAwaiter().GetResult(); }
public PollTests() { CurrentUser = Statics.LoginUser().GetAwaiter().GetResult(); }
public TestDeletePoll() { CurrentUser = Statics.LoginUser().GetAwaiter().GetResult(); }