Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
        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());
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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());
        }
Ejemplo n.º 8
0
        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;
        }
Ejemplo n.º 9
0
        public void ShouldSetBrewLength()
        {
            var recipe = new Recipe();
            recipe.SetBrewLength(new Volume(100, VolumeUnit.Litres));

            Assert.AreEqual(new Volume(100, VolumeUnit.Litres), recipe.GetBrewLength());
        }
Ejemplo n.º 10
0
        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());
        }
Ejemplo n.º 11
0
        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());
        }
Ejemplo n.º 12
0
        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());
        }