Ejemplo n.º 1
0
        public void GetSpecificAndFinalGravityTest()
        {
            Fermentable crystal60 = new Fermentable("Caramel/Crystal Malt - 60L", new FermentableCharacteristics(74, 60, 0) { Type = FermentableType.Grain, GravityPoint = 34 }, "Test Notes", "US");
            FermentableIngredient crystal60InRecipe = new FermentableIngredient(crystal60) { Amount = 0.50f };
            Fermentable chocolateMalt = new Fermentable("Chocolate Malt", new FermentableCharacteristics(60, 350, 0) { Type = FermentableType.Grain, GravityPoint = 28 }, "Test Notes", "US");
            FermentableIngredient chocolateMaltInRecipe = new FermentableIngredient(chocolateMalt) { Amount = 1 };
            Fermentable marisOtter = new Fermentable("Pale Malt, Maris Otter", new FermentableCharacteristics(82.5f, 3, 120) { Type = FermentableType.Grain, GravityPoint = 38 }, "Test Notes", "US");
            FermentableIngredient marisOtterInRecipe = new FermentableIngredient(marisOtter) { Amount = 8 };

            List<FermentableIngredient> fermentablesInRecipe = new List<FermentableIngredient>() { crystal60InRecipe, chocolateMaltInRecipe, marisOtterInRecipe };
            float actualSpecificGravity = AlcoholUtility.GetOriginalGravity(fermentablesInRecipe, 5, 70);
            Assert.AreEqual(1.049f, actualSpecificGravity);
            float actualFinalGravity = AlcoholUtility.GetFinalGravity(actualSpecificGravity, 75);
            Assert.AreEqual(1.012f, actualFinalGravity);
        }
Ejemplo n.º 2
0
        public void GetColorInSrmTest()
        {
            Fermentable crystal60 = new Fermentable("Caramel/Crystal Malt - 60L", new FermentableCharacteristics(74, 60, 0) { Type = FermentableType.Grain }, "Test Notes", "US");
            FermentableIngredient crystal60InRecipe = new FermentableIngredient(crystal60) { Amount = 0.50f };

            double crystal60Color = ColorUtility.GetColorInSrm(new[] { crystal60InRecipe }, 5);
            Assert.AreEqual(5.1, crystal60Color);

            Fermentable marisOtter = new Fermentable("Pale Malt, Maris Otter", new FermentableCharacteristics(82.5f, 3, 120) { Type = FermentableType.Grain }, "Test Notes", "US");
            FermentableIngredient marisOtterInRecipe = new FermentableIngredient(marisOtter) { Amount = 8 };

            List<FermentableIngredient> fermentablesUsed = new List<FermentableIngredient>() { marisOtterInRecipe, crystal60InRecipe };
            double colorInSrm = ColorUtility.GetColorInSrm(fermentablesUsed, 5);
            Assert.AreEqual(7.6, colorInSrm);
        }