Example #1
0
 public PizzaMaker(IIngredientsProvider ingredientsProvider, IRawPizzaBuilder rawPizzaBuilder, IOven oven)
 {
     _ingredientsProvider = ingredientsProvider;
     _rawPizzaBuilder     = rawPizzaBuilder;
     _oven             = oven;
     ReadyForMakePizza = true;
 }
 public AbstractPizzaStore()
 {
     this.domesticPizzaFactory = new DomesticPizzaFactory();
     this.regularPizzaFactory  = new RegularPizzaFactory();
     this.pizzaOven            = new PizzaOven();
     this.regularOven          = new RegularOven();
 }
        public static void CookPeeledVegetable(IChef chef, IVegetable vegetable, IOven oven)
        {
            if (vegetable == null)
            {
                return;
            }

            IMeal preparedMeal;

            if (vegetable.IsPealed && !vegetable.IsRotten)
            {
                preparedMeal = chef.Cook(oven);
            }
        }
Example #4
0
        public IMeal Cook(IOven oven)
        {
            var potato = this.GetPotato();
            var carrot = this.GetCarrot();

            var peeledPotato = this.Peel(potato);
            var peeledCarrot = this.Peel(carrot);

            var cutPotato = this.Cut(peeledPotato);
            var curCarrot = this.Cut(peeledCarrot);

            var bowl = this.GetBowl();
            var bowlWithVegetables = bowl.Add(curCarrot).Add(cutPotato);

            var preparedMeal = oven.Cook(bowlWithVegetables);

            return(preparedMeal);
        }
Example #5
0
        public void PizzaMakerSetOvenToTheProperTemperature()
        {
            // ARRANGE
            IIngredientsProvider stubIngredientsProvider = MockRepository.GenerateStub <IIngredientsProvider>();
            IRawPizzaBuilder     stubRawPizzaBUilder     = MockRepository.GenerateStub <IRawPizzaBuilder>();

            // this won't work. We can't verify this call. If you comment out the property settings in the method under test, this test won't fail
            //IOven mockOven = MockRepository.GenerateStub<IOven>();
            //mockOven.Temperature = 300;
            //mockOven.Temperature = 150;

            //this is the proper way to check settings on property
            IOven mockOven = MockRepository.GenerateMock <IOven>();

            mockOven.Expect(oven => oven.Temperature = 300);
            mockOven.Expect(oven => oven.Temperature = 150);

            // ACT
            var sut   = new PizzaMaker(stubIngredientsProvider, stubRawPizzaBUilder, mockOven);
            var pizza = sut.MakePizza();

            // ASSERT
            mockOven.VerifyAllExpectations();
        }
Example #6
0
 public Kitchen(IOven oven, IFridge fridge)
 {
     _oven   = oven;
     _fridge = fridge;
 }
Example #7
0
 /// <summary>
 /// Run in PreCommit phase to create Framelog module, IOven instance
 /// </summary>
 /// <param name="principal"></param>
 public void LogChanges(TPrincipal principal)
 {
     logger = new ChangeLogger <TChangeSet, TPrincipal>(contextInfo.ObjectContext, factory, filter);
     oven   = logger.Log(contextInfo.ObjectContext.ObjectStateManager);
 }
Example #8
0
 public Kitchen(IOven oven)
 {
     this.Oven = oven;
 }