/// 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. }
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); }
public int CreatePotato(IPotato potato) { //would typically contact a db and make a potato record throw new System.NotImplementedException(); }
public bool UpdatePotato(int potatoId, IPotato potato) { //would typically contact a db and update a potato record throw new System.NotImplementedException(); }