public void ConverttToT() { var convert = new GeneralFunctionality(); var actual = 1; Assert.AreEqual(convert.TeaspoonsToTablespoons(3), actual); }
public string ConvertTeaspoonsToTablespoons(string MeasurementInTeaspoons) { var Round = new RoundDecimalPlaces(); var ToTablespoons = new GeneralFunctionality(); var split = new SplitLines(); var TeaspoonsToTablespoons = 0m; var RoundedTablespoonMeasurement = ""; var IngredientLine = split.SplitLineAtSpace(MeasurementInTeaspoons); TeaspoonsToTablespoons = ToTablespoons.TeaspoonsToTablespoons(Convert.ToDecimal(IngredientLine[0])); if (TeaspoonsToTablespoons == 1m) { RoundedTablespoonMeasurement = Round.RoundToHundrethDecimalPlace(TeaspoonsToTablespoons) + " tablespoon"; } else { RoundedTablespoonMeasurement = Round.RoundToHundrethDecimalPlace(TeaspoonsToTablespoons) + " tablespoons"; } return(RoundedTablespoonMeasurement); }