public static string GetOvenSettingName(OvenSetting ovenSetting) { switch (ovenSetting) { case OvenSetting.BottomElementHeat: return("Bottom Element Heat"); case OvenSetting.BottomElementHeatingwithGrill: return("Bottom Element Heat With Grill"); case OvenSetting.ConventionalHeating: return("Conventional Heating"); case OvenSetting.FanOven: return("Fan Oven"); case OvenSetting.FanWithGrill: return("Fan With Grill"); case OvenSetting.Grill: return("Grill"); default: throw new InvalidOperationException(); } }
public bool Passed(int temp, int time, bool ovenLit, OvenSetting ovenSetting) { var meal = this.GetMeal(); var person = this.GetCookFor(); if (temp == MealToTemp(meal) && time == GetCookingTime(meal, person) && ovenLit == this.ShouldLightBeTurnedOn && ovenSetting == this.GetOvenSetting()) { return(true); } else { return(false); } }