示例#1
0
        public decimal GetAmountOfOuncesUsed(string Ingredient, string measuredCups, string filename)
        {
            var vw     = new VolumeToWeightLogic();
            var divide = new GeneralFunctionality();
            var GetOuncesForIngredient = vw.ReadOuncesForIngredient(Ingredient, filename);
            var GetPercentMeasuredCupsToStandardCups = vw.PercentageOfMeasuredCupsToStandardCups(measuredCups);

            return(GetPercentMeasuredCupsToStandardCups * GetOuncesForIngredient);
        }
示例#2
0
        public void ReadOuncesForVanillaExtract()
        {
            var vw       = new VolumeToWeightLogic();
            var filename = @"C:\Users\Rachel\Documents\Visual Studio 2015\Projects\RachelsRoses\Rachel-s-Roses\VolumeToWeightIngredientData.txt";
            var expected = 6.86m;
            var actual   = vw.ReadOuncesForIngredient("vanilla", filename);

            Assert.AreEqual(expected, actual);
        }
示例#3
0
        public void ReadOuncesForWhiteSugar()
        {
            var vw       = new VolumeToWeightLogic();
            var filename = @"C:\Users\Rachel\Documents\Visual Studio 2015\Projects\RachelsRoses\Rachel-s-Roses\VolumeToWeightIngredientData.txt";
            var expected = 7.1m;
            var actual   = vw.ReadOuncesForIngredient("white sugar", filename);

            Assert.AreEqual(expected, actual);
        }
示例#4
0
        //public static Func<string, string, decimal, decimal, decimal> DeterminePriceForStandardMeasuredIngredient
        //    = (name, sizeBoughtInPounds, ouncesPerStandard, price) => (ouncesPerStandard / (Convert.ToDecimal(sizeBoughtInPounds) * 16)) * price;

        ///*
        // To do next:
        //    get price per ounce
        //        will have to know if item is sold in pounds/gallons/ounces, and do logic to determine price per ounce
        //    multiply price per ounce by how many ounces of an ingredient i used

        //*/
        //public decimal ConvertToOunces(string ProductName)
        //{
        //    var convertToOunces = new GeneralFunctionality();
        //    if ((ProductName.ToLower()).Contains("lb") || (ProductName.ToLower().Contains("pound")))
        //       {

        //        }
        //    "oz"
        //        "gallons"
        //        "pint"
        //        "egg"

        //public void DetermineIfNameHasLbs(string Ingredient)
        //{
        //    //Pillsbury Flour 10 lb
        //}



        //public static decimal PricePerOunceUsed(string Ingredient, string MeasuredCups, string filename)
        //{
        //    var CalculateOunces = new VolumeToWeightLogic();
        //    var response = new ItemResponse();
        //    var priceForItem = response.SalePrice;
        //    var standardOunceForIngredient = CalculateOunces.ReadOuncesForIngredient(Ingredient, filename);
        //    var measuredOunces = CalculateOunces.GetAmountOfOuncesUsed(Ingredient, MeasuredCups, filename);
        //}

        //get price for 1 cup of ingredient
        //determine percent of standard based on how many cups (just multiply the ounces by the measured cups)
        public decimal DeterminePriceForOuncesUsed(string Ingredient, string MeasuredCups, string filename)
        {
            //this is just a super long way of saying when I use 2 1/2 c of flour, i use 2.5x the standard amount...
            var GetOunces = new VolumeToWeightLogic();
            var response  = new ItemResponse();
            var price     = response.SalePrice;
            var standardOuncesForIngredient = GetOunces.ReadOuncesForIngredient(Ingredient, filename);
            var MeasuredOunces = GetOunces.GetAmountOfOuncesUsed(Ingredient, MeasuredCups, filename);
            var Percentage     = MeasuredOunces / standardOuncesForIngredient;

            return(Percentage);
        }