public HamPhrase( IFoodProduct currentFood, HamType Ham) { this.currentFood = currentFood; this.Ham = Ham; }
public Ham( IFoodProduct decoratedInstance, int weight, HamType hamType) : base(decoratedInstance, weight) { this.hamType = hamType; }
private Ingredients.Ham.Ham GetInstanceUnderTest(int weight, HamType typeOfHam) { var foodIngrediantMock = new Mock <IFoodProduct>(); return(new Ingredients.Ham.Ham( foodIngrediantMock.Object, weight, typeOfHam)); }
public void GetMyOwnCalories_WeightAndTypeSpecified_EmitsWeightAndTypeRelatedCalories( int weight, HamType typeOfHam, int expectedCalories) { var instanceUnderTest = this.GetInstanceUnderTest(weight, typeOfHam); instanceUnderTest.GetMyOwnCalories().Should().Be(expectedCalories); }
private int GetPriceForHundredGrammHamType( HamType typeOfHam) { int price = 0; switch (typeOfHam) { case HamType.Pancetta: price = 170; break; case HamType.BlackForest: price = 195; break; default: throw new ArgumentOutOfRangeException(nameof(typeOfHam)); } return(price); }
private int GetCaloriesOfHundredGrammForHamType( HamType typeOfHam) { int calories = 0; switch (typeOfHam) { case HamType.Pancetta: calories = 120; break; case HamType.BlackForest: calories = 143; break; default: throw new ArgumentOutOfRangeException(nameof(typeOfHam)); } return(calories); }
public static HamPhrase AddHam(this IFoodProduct instance, HamType typeOfHam) { return(new HamPhrase(instance, typeOfHam)); }