Beispiel #1
0
        /// First if statement from homework
        internal void CookPotato(IPotato potato)
        {
            bool isPotatoNotNull      = potato != null;
            bool isPotatoReadyForCook = !potato.IsPealed && !potato.IsRotten;

            if (isPotatoNotNull && isPotatoReadyForCook)
            {
                this.CookPotato(potato);
            }
        }
        public void MeaninglessTest()
        {
            //Setup mock provider
            int    potatoId     = 12345;
            Potato returnPotato = new Potato();

            dbProvider.Setup(p => p.GetPotato(potatoId)).Returns(returnPotato);

            //Call real controller code
            IPotato result = potatoController.GetPotato(potatoId);

            //No assertions
            //What happened? Who knows? The test passes.
        }
Beispiel #3
0
        public void Cook()
        {
            IPotato potato = GetPotato();
            ICarrot carrot = GetCarrot();

            Peel(potato);
            Peel(carrot);

            Cut(potato);
            Cut(carrot);

            IBowl bowl = GetBowl();

            bowl.Add(carrot);
            bowl.Add(potato);
        }
Beispiel #4
0
 public int CreatePotato(IPotato potato)
 {
     //would typically contact a db and make a potato record
     throw new System.NotImplementedException();
 }
Beispiel #5
0
 public bool UpdatePotato(int potatoId, IPotato potato)
 {
     //would typically contact a db and update a potato record
     throw new System.NotImplementedException();
 }