Exemple #1
0
        public async Task TestInsert()
        {
            try
            {
                Election election = new Election()
                {
                    Date           = new DateTime(2022, 11, 3).Date,
                    StartDateLocal = new DateTime(2022, 11, 1, 8, 0, 0),
                    EndDateLocal   = new DateTime(2022, 11, 3, 20, 0, 0),
                    Description    = "2022 November Election",
                    Version        = "0.0.0.0",
                    AllowUpdates   = false
                };
                UOW.BeginTransaction();
                Election inserted = await electionService.Insert(UOW, election);

                UOW.CloseTransaction();
                Assert.IsNotNull(inserted);
                Assert.IsTrue(inserted.Id != Guid.Empty, "Expect inserted Election Id not be empty");
            }
            catch (Exception ex)
            {
                Assert.IsNull(ex, "Exception Thrown: " + ex.Message);
            }
        }