Exemplo n.º 1
0
        public void LoadTest()
        {
            List <Meal> meals = new List <Meal>();

            meals = MealManager.Load();
            Assert.AreEqual(5, meals.Count());
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 public IEnumerable <Meal> Get(Guid userid)
 {
     return(MealManager.Load(userid));
 }
Exemplo n.º 5
0
 // GET api/values
 public IEnumerable <Meal> Get()
 {
     return(MealManager.Load());
 }