Пример #1
0
        public async Task TestGetFullElection()
        {
            try
            {
                Election result = await electionService.GetFullElection(Context, DefaultElectionId);

                Assert.IsNotNull(result, "Expect to find the default Election");
                Assert.IsTrue(result.CategoryList.Count == 142, "Expect default dataset to have 142 categories, found " + result.CategoryList.Count);
                Assert.IsTrue(result.PartyList.Count >= 6, "Expect default dataset to have 6 parties has " + result.PartyList.Count);
                int totaltickets = 0;
                foreach (Category cat in result.CategoryList)
                {
                    totaltickets += cat.Tickets.Count;
                }
                Assert.IsTrue(totaltickets == 379, "Expect default dataset to have 379 tickets, found " + totaltickets);
            }
            catch (Exception ex)
            {
                Assert.IsNull(ex, "Exception Thrown: " + ex.Message);
            }
        }