Ejemplo n.º 1
0
        public void GetRecipes_RecipeOnAMonday_1RecipeReturned
            (int day, int month, int year, int week)
        {
            _uut.Foodplan.RecipeList.Add(new Tuple <Recipe, DateTime>
                                             (new Recipe(), new DateTime(year, month, day)));
            var list = _uut.GetRecipes(week, year);

            Assert.That(list.Count, Is.EqualTo(1));
        }
 public void UpdateFoodplan_NoWeekOrYearSelected_RecipeListIsEmpty()
 {
     _foodplanModel.GetRecipes(Arg.Any <int>(), Arg.Any <int>()).Returns(new Collection <Recipe>()
     {
         new Recipe()
         {
             RecipeName = "Test", Procedure = "Test"
         }
     });
     Assert.That(_uut.Foodplan.Count, Is.EqualTo(0));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Updates the view model's foodplan with recipes in selected week and year.
        /// </summary>
        private async void UpdateFoodplan()
        {
            await _foodplanModel.Update();

            var recipes = _foodplanModel.GetRecipes(_selectedWeek, _selectedYear);

            if (recipes != null)
            {
                Foodplan = new ObservableCollection <Recipe>(recipes);
                //      NotifyPropertyChanged("Foodplan");
            }
        }