public static ABVDto CalculateABVDto(RecipeDto recipe) { var abv = new ABVDto { AbvId = recipe.Id, Miller = Math.Round(Formulas.MillerABV(recipe.OG, recipe.FG), 2), Simple = Math.Round(Formulas.SimpleABV(recipe.OG, recipe.FG), 2), Advanced = Math.Round(Formulas.AdvancedABV(recipe.OG, recipe.FG), 2), AdvancedAlternative = Math.Round(Formulas.AdvancedAlternativeABV(recipe.OG, recipe.FG), 2), AlternativeSimple = Math.Round(Formulas.SimpleAlternativeABV(recipe.OG, recipe.FG), 2), Standard = Math.Round(Formulas.MicrobrewitABV(recipe.OG, recipe.FG), 2) }; return(abv); }
public void CalculateAdvancedABV() { var advanced = Math.Round(Formulas.AdvancedABV(1.05, 1.01), 2); Assert.AreEqual(5.19, advanced); }