コード例 #1
0
        public void Delete()
        {
            var record = new PizzaBox.Domain.Models.Elements.Customer();

            record.DoB        = System.DateTime.UtcNow;
            record.Email      = "*****@*****.**";
            record.FirstName  = "smegul";
            record.MiddleName = "precious";
            record.LastName   = "evil";
            record.Phone      = "433-081-4761";
            record.Gender     = false;

            record.Save();

            System.Guid test = record.Id;

            record.Delete();

            using (var context = new PizzaBox.Data.PizzaBoxDbContext())
                if (context.People.Find(test) == null)
                {
                    Assert.Pass();
                }
                else
                {
                    Assert.Fail();
                }
        }
コード例 #2
0
        public void Write()
        {
            var record = new PizzaBox.Domain.Models.Elements.Customer();

            record.DoB        = System.DateTime.UtcNow;
            record.Email      = "*****@*****.**";
            record.FirstName  = "me";
            record.MiddleName = "so";
            record.LastName   = "soTired";
            record.Phone      = "333-555-0908";
            record.Gender     = true;

            record.Save();

            using (var context = new PizzaBox.Data.PizzaBoxDbContext())
                if (context.People.Find(record.Id).Id != System.Guid.Empty)
                {
                    Assert.Pass("Value: {0}", record.Id);
                }
                else
                {
                    Assert.Fail("Value: {0}", record.Id);
                }
        }