示例#1
0
 public void AfterScenario()
 {
     using (dbContext = new NorthwindEntitiesInTest())
     {
         dbContext.Database.ExecuteSqlCommand("Delete [Orders] Where CustomerID IN ('Joey','JoeyTest')");
         dbContext.Database.ExecuteSqlCommand("Delete [Customers] Where CustomerID IN('Joey','JoeyTest')");
     }
 }
示例#2
0
 public void BeforeScenario()
 {
     this.target = new OrderService();
     using (dbContext = new NorthwindEntitiesInTest())
     {
         dbContext.Database.ExecuteSqlCommand("Delete [Orders] Where CustomerID IN ('Joey','JoeyTest')");
         dbContext.Database.ExecuteSqlCommand("Delete [Customers] Where CustomerID IN('Joey','JoeyTest')");
     }
 }
示例#3
0
        public void Given預計Orders資料應有(Table table)
        {
            var orders = table.CreateSet<SpecFlowWithEf.Tests.ModelInTest.Orders>();

            using (dbContext = new NorthwindEntitiesInTest())
            {
                foreach (var order in orders)
                {
                    dbContext.Orders.Add(order);
                }
                dbContext.SaveChanges();
            }
        }