Exemplo n.º 1
0
        public void TestMethodSaveTicket()
        {
            var cx = new TrexContext();

            var initial = cx.Tickets.Count();

            for (int i = 0; i < 5; i++)
            {
                cx.Tickets.Add(new Ticket()
                {
                    Id           = Guid.NewGuid(),
                    Added        = DateTime.Now,
                    AssigneeUser = null,
                    Due          = DateTime.Now.AddYears(1),
                    Notes        = "testingtestingthisbreakxyz12312DHV(UGIWHOIEHF(&*#@^$%^*&(@#",
                    Subject      = "test ticket count",
                    Submitter    = "bob jones"
                });
            }
            cx.SaveChanges();
            cx.Dispose();

            var cx2   = new TrexContext();
            var after = cx2.Tickets.Count();

            Assert.AreEqual(initial + 5, after, "Not 5 records saved");
        }
Exemplo n.º 2
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }