Exemplo n.º 1
0
        public void ShowRecipeCommand_UserClickAdd_FoodplanColelctorReceivesAddRecipeTupleToFoodplan()
        {
            //Setup
            ISubWindowFactory fac = Substitute.For <ISubWindowFactory>();

            _sut.SetWindowFactory(fac);
            IRecipeInformationWindowDialog dia = Substitute.For <IRecipeInformationWindowDialog>();

            fac.GetRecipeInformationWindow(Arg.Any <Recipe>(), Arg.Any <Window>(), Arg.Any <string>()).Returns(dia);
            dia.ShowDialog().Returns(true);

            Recipe r = new Recipe();

            _sut.ShowRecipeCommand.Execute(r);
            _foodplanCollector.Received().AddRecipeTupleToFoodplan(_loginModel.FoodplanId, new Tuple <Recipe, DateTime>(r, Arg.Any <DateTime>()));
        }
Exemplo n.º 2
0
        public void RemoveRecipe_RemoveRecipeById_CollectorFuncCalled()
        {
            const int id = 1;

            _uut.RemoveRecipe(id);
            _foodplanCollector.Received().RemoveRecipe(Arg.Any <int>(), id);
        }