Beispiel #1
0
        public void Delete()
        {
            var record = new PizzaBox.Domain.Models.Elements.Business();

            record.Name = "Delete Test Pizzoria";

            record.Addresses.Add((new PizzaBox.Data.Entities.Address {
                Apt = "A",
                City = "Orlando",
                State = "TX",
                Street = "Write Employee Street",
                Zip = "91837"
            }));

            record.Save();
            record.Delete();

            using (var context = new PizzaBox.Data.PizzaBoxDbContext())
                if (context.Outlets.Find(record.Id) == null)
                {
                    Assert.Pass();
                }
                else
                {
                    Assert.Fail();
                }
        }
Beispiel #2
0
        public void Write()
        {
            var record = new PizzaBox.Domain.Models.Elements.Business();

            record.Name = "Write Test Pizzoria";

            record.Addresses.Add(new PizzaBox.Data.Entities.Address {
                Apt    = "A",
                City   = "Ontario",
                State  = "TX",
                Street = "Write Employee Street",
                Zip    = "91837"
            });

            record.Save();

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