public void AccumulatingTeaspoonsFromVariousMeasurements9() { var convert = new ConvertMeasurement(); var expected = 1.06m; var actual = convert.AccumulatedTeaspoonMeasurement("1 teaspoon 1 pinch"); Assert.AreEqual(expected, actual); }
public void AccumulatingTeaspoonsFromVariousMeasurements6() { var convert = new ConvertMeasurement(); var expected = 56.5m; var actual = convert.AccumulatedTeaspoonMeasurement("1 cup 2 tablespoons 2 1/2 teaspoons"); Assert.AreEqual(expected, actual); }
public void AccumulatingTeaspoonsFromVariousMeasurements7() { var convert = new ConvertMeasurement(); var expected = 77.12m; var actual = convert.AccumulatedTeaspoonMeasurement("1 1/2 cups 1 tablespoon 2 1/8 teaspoons"); 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); }