예제 #1
0
        public void LoadTest()
        {
            List <Meal> meals = new List <Meal>();

            meals = MealManager.Load();
            Assert.AreEqual(5, meals.Count());
        }
예제 #2
0
        public void DeleteTest()
        {
            List <Meal> meals = MealManager.Load();
            Meal        meal  = meals.FirstOrDefault(u => u.Description == "Breakfast");

            int results = MealManager.Delete(meal, true);

            Assert.IsTrue(results > 0);
        }
예제 #3
0
        public void InsertTest()
        {
            List <Meal> meals    = MealManager.Load();
            FoodItem    foodItem = new FoodItem();

            foodItem.Id       = Guid.NewGuid();
            foodItem.FDCId    = 5555555;
            foodItem.MealId   = meals.FirstOrDefault(m => m.Description == "Breakfast").Id;
            foodItem.Quantity = 999;

            int results = FoodItemManager.Insert(foodItem, true);

            Assert.IsTrue(results > 0);
        }
예제 #4
0
 public IEnumerable <Meal> Get(Guid userid)
 {
     return(MealManager.Load(userid));
 }
예제 #5
0
 // GET api/values
 public IEnumerable <Meal> Get()
 {
     return(MealManager.Load());
 }