Exemplo n.º 1
0
        public void CalculateOuncesForOneAndAHalfCupsBananas()
        {
            var vw       = new VolumeToWeightLogic();
            var filename = @"C:\Users\Rachel\Documents\Visual Studio 2015\Projects\RachelsRoses\Rachel-s-Roses\VolumeToWeightIngredientData.txt";
            var expected = 18m;
            var actual   = vw.GetAmountOfOuncesUsed("bananas", "1.5", filename);

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void CalculateOuncesForSixAndAnEighthCups()
        {
            var vw       = new VolumeToWeightLogic();
            var filename = @"C:\Users\Rachel\Documents\Visual Studio 2015\Projects\RachelsRoses\Rachel-s-Roses\VolumeToWeightIngredientData.txt";
            var expected = 31.25m;
            var actual   = vw.GetAmountOfOuncesUsed("flour", "6.25", filename);

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
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);
        }