public void TestOuncesConsumedBasedOnMeasurement3() { var convert = new ConvertDensity(); var i = new Ingredient("Grandulated Sugar") { measurement = "1 teaspoon", density = 7.1m }; var expected = .15m; var actual = convert.CalculateOuncesUsed(i); Assert.AreEqual(expected, actual); }
public void TestOuncesConsumedBasedOnMeasurement2() { var convert = new ConvertDensity(); var i = new Ingredient("Bread Flour") { measurement = "5 2/3 cups", density = 5.4m }; var expected = 30.60m; var actual = convert.CalculateOuncesUsed(i); Assert.AreEqual(expected, actual); }
public void TestOuncesConsumedBasedOnMeasurement4() { var convert = new ConvertDensity(); var i = new Ingredient("Baking Soda") { measurement = "1/4 teaspoon", density = 8.57m }; var expected = .04m; var actual = convert.CalculateOuncesUsed(i); Assert.AreEqual(expected, actual); }
public void TestOuncesConsumedBasedOnMeasurement() { var convert = new ConvertDensity(); var i = new Ingredient("Confectioner's Sugar") { measurement = "3 cups", density = 4.4m }; var expected = 13.2m; var actual = convert.CalculateOuncesUsed(i); Assert.AreEqual(expected, actual); }
public decimal CalculateOuncesConsumedFromMeasurement(Ingredient i) { var dbIngredients = new DatabaseAccessIngredient(); var convertMeasurement = new ConvertMeasurement(); var convertWeight = new ConvertWeight(); var convert = new ConvertDensity(); var myIngredientIngredientsTableData = dbIngredients.queryIngredientFromIngredientsTableByName(i); var myConsumedOunces = 0m; var temp = new Ingredient(); if (myIngredientIngredientsTableData.classification.ToLower().Contains("egg")) { var accumulatedOunces = convertMeasurement.AccumulatedTeaspoonMeasurement(i.measurement); if (i.classification.ToLower().Contains("egg")) { var splitEggMeasurement = convertWeight.SplitWeightMeasurement(i.sellingWeight); i.sellingWeightInOunces = decimal.Parse(splitEggMeasurement[0]); } } myConsumedOunces = convert.CalculateOuncesUsed(i); return(myConsumedOunces); }