Exemple #1
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());
        }
        void SetupFermentables()
        {
            var grain1 = new StockFermentable("Pils Malt", 1.045M);
            var grain2 = new StockFermentable("Amber Malt", 1.040M);

            var grains = new List<IFermentable>
                             {
                                 grain1,
                                 grain2
                             };

            grainVMs = new List<IFermentableViewModel>
                           {
                               new FermentableViewModel(grains[0]),
                               new FermentableViewModel(grains[1])
                           };

            _stockItemsRepository.Expect(x => x.GetStockFermentables()).Return(grains).Repeat.Any();
        }
Exemple #3
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());
        }
Exemple #4
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;
        }
Exemple #5
0
 public void GrainsShouldAlwaysHaveAName()
 {
     var grain = new StockFermentable("Pils Malt", 1.045M);
     Assert.AreEqual("Pils Malt", grain.Name);
 }
Exemple #6
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());
        }
Exemple #7
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());
        }