public RecipeFermentable(Recipe recipe, IFermentable fermentable, Weight weight, decimal pppg) : base(fermentable.Name) { this.recipe = recipe; this.fermentable = fermentable; this.weight = weight; this.pppg = pppg; }
public RecipeHop(IHop hop, Weight weight, int boilTime, decimal alphaAcid, Recipe recipe) : base(hop.Name) { this.hop = hop; this.Weight = weight; this.BoilTime = boilTime; this.alphaAcid = alphaAcid; this.Recipe = recipe; }
public void ShouldBeAbleToSetTheWeightOfHops() { var hop = new Hop("Saaz"); var recipe = new Recipe(); recipe.AddHop(hop, new Weight(10, MassUnit.Grams), 60); Assert.AreEqual(new Weight(10, MassUnit.Grams), recipe.GetTotalHopWeight()); }
public RecipeHop(IHop hop, Weight weight, int boilTime, Recipe recipe) : base(hop.Name) { //this.hop = hop; this.Name = hop.Name; this.Description = hop.Description; this.AddOilCharacteristics(hop.GetCharacteristics()); this.Weight = weight; this.BoilTime = boilTime; this.Recipe = recipe; }
public void ShouldBeAbleToAddGrains() { var grain1 = new StockFermentable("Pils Malt 1", 1.045M); var grain2 = new StockFermentable("Pils Malt 2", 1.045M); var recipe = new Recipe(); recipe.AddFermentable(grain1, 1.KiloGram()); recipe.AddFermentable(grain2, 2.KiloGrams()); Assert.AreEqual(3.KiloGrams(), recipe.GetTotalGrainWeight()); }
public EditRecipeViewModel(IEventAggregator eventAggregator, IStockItemsViewModel stockItemsViewModel, IRecipeRepository recipeRepository) { this._recipeRepository = recipeRepository; StockItemsViewModel = stockItemsViewModel; VolumeUnits = new List<VolumeUnit> { VolumeUnit.Litres, VolumeUnit.Gallons }; _recipe = new Recipe(); _recipe.SetBrewLength(20.Litres()); eventAggregator.GetEvent<AddHopToRecipeEvent>().Subscribe(AddHop); eventAggregator.GetEvent<AddFermentableToRecipeEvent>().Subscribe(AddFermentable); }
public void ShouldCalculateBuGuRatioAsZeroIfNoHops() { var grain1 = new StockFermentable("Wheat", 1.045M); var recipe = new Recipe(); recipe.SetBrewLength(1.Gallons()); recipe.AddFermentable(grain1, 1.Pound(), 1.045M); Assert.AreEqual(0M, recipe.GetBuGuRatio()); }
private static Recipe SimpleRecipe() { var grain1 = new StockFermentable("Wheat", 1.045M); var hop = new Hop("Saaz"); var recipe = new Recipe(); recipe.SetBrewLength(1.Gallons()); recipe.AddFermentable(grain1, 1.Pound(), 1.045M); recipe.AddHop(hop, new Weight(10M, MassUnit.Grams), 60, 12.5M); return recipe; }
public void ShouldSetBrewLength() { var recipe = new Recipe(); recipe.SetBrewLength(new Volume(100, VolumeUnit.Litres)); Assert.AreEqual(new Volume(100, VolumeUnit.Litres), recipe.GetBrewLength()); }
public void ShouldHandleGramsAndKilograms() { var hop1 = new Hop("Saaz 1"); var hop2 = new Hop("Saaz 2"); var recipe = new Recipe(); recipe.AddHop(hop1, new Weight(10, MassUnit.Grams), 60); recipe.AddHop(hop2, new Weight(1, MassUnit.KiloGrams), 60); Assert.AreEqual(new Weight(1010, MassUnit.Grams), recipe.GetTotalHopWeight()); }
public void ShouldCalculateStartingGravityWithMultipleGrains() { var grain1 = new StockFermentable("Wheat", 1.045M); var grain2 = new StockFermentable("Honey", 1.045M); var grain3 = new StockFermentable("Two-row", 1.046M); var recipe = new Recipe(); recipe.SetBrewLength(new Volume(3M, VolumeUnit.Gallons)); recipe.AddFermentable(grain1, new Weight(1M, MassUnit.Pounds), 1.045M); recipe.AddFermentable(grain2, new Weight(1M, MassUnit.Pounds), 1.045M); recipe.AddFermentable(grain3, new Weight(1M, MassUnit.Pounds), 1.046M); Assert.AreEqual(1.045M, recipe.GetStartingGravity()); }
public void ShouldCalculateStartingGravity() { var grain1 = new StockFermentable("Wheat", 1.035M); var recipe = new Recipe(); recipe.SetBrewLength(new Volume(1, VolumeUnit.Gallons)); recipe.AddFermentable(grain1, new Weight(1, MassUnit.Pounds), 1.045M); Assert.AreEqual(1.045M, recipe.GetStartingGravity()); }