Esempio n. 1
0
        public void CreateWorkDaysTest()
        {
            ApplicationDbInitializer.CreateWorkingDays(dataContext);
            List <WorkingDay> workingDays = dataContext.WorkingDays.ToList();

            Assert.IsTrue(workingDays.Count > 0);
        }
Esempio n. 2
0
        protected override void Seed(ApplicationDbContext context)
        {
            ApplicationDbInitializer.InitializeIdentityForEf(context, _path);
            var dishes = ApplicationDbInitializer.GetDishesFromXml(context, _path);

            ApplicationDbInitializer.CreateWorkingDays(context);
            ApplicationDbInitializer.CreateMenuForWeek(context, dishes);
            _path = _path.Replace(@"DishDetails", "Employeers");
            ApplicationDbInitializer.GetUsersFromXml(context, _path);
            ApplicationDbInitializer.CreateOrders(context);
            _path = _path.Replace(@"Employeers.xml", "storedfunc.sql");
            Utility.CreateStoredFuncs(_path);
        }
Esempio n. 3
0
        public void TestMigration()
        {
            string _path = AppDomain.CurrentDomain.BaseDirectory.Replace(@"UnitTestProject1\bin\Debug", "") +
                           @"ACSDining.Web\App_Data\DBinitial\DishDetails.xml";

            ApplicationDbInitializer.InitializeIdentityForEf(dataContext, _path);

            ApplicationDbInitializer.CreateWorkingDays(dataContext);

            var dishes = ApplicationDbInitializer.GetDishesFromXml(dataContext, _path);

            ApplicationDbInitializer.CreateMenuForWeek(dataContext, dishes);

            _path = _path.Replace(@"DishDetails", "Employeers");

            ApplicationDbInitializer.GetUsersFromXml(dataContext, _path);
            ApplicationDbInitializer.CreateOrders(dataContext);

            List <DishQuantity> dqualist = dataContext.DishQuantities.ToList();

            Assert.IsTrue(dqualist.Count > 0);
        }