Example #1
0
        /// <summary>
        /// Update the list of Data to Convert variable to reflect the tests we want to perform
        /// </summary>
        /// <remarks>
        /// Database query to view all measurement values:
        ///      select uomtl.Name, uoml.Name, uom.Abbreviation, uom.PreCalcAddition, uom.Multiplier, uom.PostCalcAddition
        ///      from reference.UnitOfMeasure uom
        ///      join localization.SystemLabel uoml on uoml.LabelID = uom.LabelID
        ///      join reference.UnitOfMeasureType uomt on uom.UnitOfMeasureTypeID = uomt.UnitOfMeasureTypeID
        ///      join localization.SystemLabel uomtl on uomtl.LabelID = uomt.LabelID
        /// </remarks>
        private UomConversionTestDataList GetConvertedDataByMeasurementValues()
        {
            UomConversionTestDataList listDataToConvert = new UomConversionTestDataList();
            //--------------------- ----------------- -------------- ----------------- ------------------------ -------------------
            // The Common Volume Calculation is based on the Liter
            // UOM Type Name         UOM Name         Abbreviation   PreCalcAddition   Multiplier               PostCalcAddition
            //--------------------- ----------------- -------------- ----------------- ------------------------ -------------------
            //Volume(L)             Liter             L              0.000             1.0000000000000000000    0.000
            listDataToConvert.Add("1 Liter to Liter Test", UnitOfMeasure.VolumeLiter, UnitOfMeasure.VolumeLiter, 1, 3, 1);

            //Volume(L)             US Gallon         US Gal.        0.000             3.7854117840000000000    0.000
            listDataToConvert.Add("1 Liter to Gallon Test", UnitOfMeasure.VolumeLiter, UnitOfMeasure.VolumeUSGallon, 1, 5, 0.26417);
            listDataToConvert.Add("1 Gallon to Liter Test", UnitOfMeasure.VolumeUSGallon, UnitOfMeasure.VolumeLiter, 1, 9, 3.785411784);

            //Volume(L)             US Gallon         US Gal.        0.000             3.7854117840000000000    0.000
            listDataToConvert.Add("1 Liter to Milliliter Test", UnitOfMeasure.VolumeLiter, UnitOfMeasure.VolumeMilliliter, 1, 4, 1000.0);
            listDataToConvert.Add("1 Milliliter to Liter Test", UnitOfMeasure.VolumeMilliliter, UnitOfMeasure.VolumeLiter, 1, 4, 0.001);

            //Volume(L)             Barrels           bbl            0.000             117.0000000000000000000  0.000
            listDataToConvert.Add("1 Liter to Barrels Test", UnitOfMeasure.VolumeLiter, UnitOfMeasure.VolumeBarrels, 1, 11, 0.00838641437);
            listDataToConvert.Add("1 Barrels to Liter Test", UnitOfMeasure.VolumeBarrels, UnitOfMeasure.VolumeLiter, 1, 6, 119.240471);
            listDataToConvert.Add("1 Gallon to Barrels Test", UnitOfMeasure.VolumeUSGallon, UnitOfMeasure.VolumeBarrels, 1, 10, 0.0317460318);
            listDataToConvert.Add("1 Barrels to Gallon Test", UnitOfMeasure.VolumeBarrels, UnitOfMeasure.VolumeUSGallon, 1, 3, 31.5);

            //Volume(L)             Liquid Ounce      oz             0.000             0.0295735296000000000    0.000
            listDataToConvert.Add("1 Liter to Liquid Ounce Test", UnitOfMeasure.VolumeLiter, UnitOfMeasure.VolumeLiquidOunce, 1, 10, 33.8140226590);
            listDataToConvert.Add("1 Liquid Ounce to Liter Test", UnitOfMeasure.VolumeLiquidOunce, UnitOfMeasure.VolumeLiter, 1, 10, 0.0295735296);
            listDataToConvert.Add("1 Gallon to Liquid Ounce Test", UnitOfMeasure.VolumeUSGallon, UnitOfMeasure.VolumeLiquidOunce, 1, 3, 128);
            listDataToConvert.Add("1 Liquid Ounce to Gallon Test", UnitOfMeasure.VolumeLiquidOunce, UnitOfMeasure.VolumeUSGallon, 1, 7, 0.0078125);
            listDataToConvert.Add("1 Barrels to Liquid Ounce Test", UnitOfMeasure.VolumeBarrels, UnitOfMeasure.VolumeLiquidOunce, 1, 3, 4032);
            listDataToConvert.Add("1 Liquid Ounce to Barrels Test", UnitOfMeasure.VolumeLiquidOunce, UnitOfMeasure.VolumeBarrels, 1, 6, 0.000248);

            //Volume(L)             Cup               cup            0.000             0.2365882360000000000    0.000
            listDataToConvert.Add("1 Liter to Cup Test", UnitOfMeasure.VolumeLiter, UnitOfMeasure.VolumeCup, 1, 5, 4.22675);
            listDataToConvert.Add("1 Cup to Liter Test", UnitOfMeasure.VolumeCup, UnitOfMeasure.VolumeLiter, 1, 9, 0.236588236);
            listDataToConvert.Add("1 Gallon to Cup Test", UnitOfMeasure.VolumeUSGallon, UnitOfMeasure.VolumeCup, 1, 3, 16);
            listDataToConvert.Add("1 Cup to Gallon Test", UnitOfMeasure.VolumeCup, UnitOfMeasure.VolumeUSGallon, 1, 9, 0.0625);
            listDataToConvert.Add("1 Barrels to Cup Test", UnitOfMeasure.VolumeBarrels, UnitOfMeasure.VolumeCup, 1, 3, 504);
            listDataToConvert.Add("1 Cup to Barrels Test", UnitOfMeasure.VolumeCup, UnitOfMeasure.VolumeBarrels, 1, 11, 0.00198412698);
            listDataToConvert.Add("1 Liquid Ounce to Cup Test", UnitOfMeasure.VolumeLiquidOunce, UnitOfMeasure.VolumeCup, 1, 3, 0.125);
            listDataToConvert.Add("1 Cup to Liquid Ounce Test", UnitOfMeasure.VolumeCup, UnitOfMeasure.VolumeLiquidOunce, 1, 3, 8);

            //Volume(L)             hectoliter        hl             0.000             100.0000000000000000000  0.000
            listDataToConvert.Add("1 Liter to HectoLiter Test", UnitOfMeasure.VolumeLiter, UnitOfMeasure.VolumeHectoliter, 1, 3, 0.01);
            listDataToConvert.Add("1 HectoLiter to Liter Test", UnitOfMeasure.VolumeHectoliter, UnitOfMeasure.VolumeLiter, 1, 3, 100.000);
            listDataToConvert.Add("1 Gallon to HectoLiter Test", UnitOfMeasure.VolumeUSGallon, UnitOfMeasure.VolumeHectoliter, 1, 7, 0.0378541);
            listDataToConvert.Add("1 HectoLiter to Gallon Test", UnitOfMeasure.VolumeHectoliter, UnitOfMeasure.VolumeUSGallon, 1, 7, 26.4172052);
            listDataToConvert.Add("1 Barrels to HectoLiter Test", UnitOfMeasure.VolumeBarrels, UnitOfMeasure.VolumeHectoliter, 1, 7, 1.1924047);
            listDataToConvert.Add("1 HectoLiter to Barrels Test", UnitOfMeasure.VolumeHectoliter, UnitOfMeasure.VolumeBarrels, 1, 7, 0.8386414);
            listDataToConvert.Add("1 Liquid Ounce to HectoLiter Test", UnitOfMeasure.VolumeLiquidOunce, UnitOfMeasure.VolumeHectoliter, 1, 7, 0.0002957);
            listDataToConvert.Add("1 HectoLiter to Liquid Ounce Test", UnitOfMeasure.VolumeHectoliter, UnitOfMeasure.VolumeLiquidOunce, 1, 7, 3381.4022659);
            listDataToConvert.Add("1 Cup to HectoLiter Test", UnitOfMeasure.VolumeCup, UnitOfMeasure.VolumeHectoliter, 1, 7, 0.0023659);
            listDataToConvert.Add("1 HectoLiter to Cup Test", UnitOfMeasure.VolumeHectoliter, UnitOfMeasure.VolumeCup, 1, 7, 422.6752847);

            //--------------------- ----------------- -------------- ----------------- ------------------------ -------------------
            // The Common Weight Calculation is based on the Kilogram
            // UOM Type Name         UOM Name         Abbreviation   PreCalcAddition   Multiplier               PostCalcAddition
            //--------------------- ----------------- -------------- ----------------- ------------------------ -------------------
            //Weight(Kg)            Kilogram          Kg             0.000             1.0000000000000000000    0.000
            listDataToConvert.Add("1 Kilogram to Kilogram Test", UnitOfMeasure.WeightKilogram, UnitOfMeasure.WeightKilogram, 1, 3, 1);

            //Weight(Kg)            Pound             lbs            0.000             0.4535923700000000000    0.000
            listDataToConvert.Add("1 Kilogram to Pound Test", UnitOfMeasure.WeightKilogram, UnitOfMeasure.WeightPound, 1, 8, 2.20462262);
            listDataToConvert.Add("1 Pound to Kilogram Test", UnitOfMeasure.WeightPound, UnitOfMeasure.WeightKilogram, 1, 8, 0.45359237);

            //Weight(Kg)            Ounce             oz             0.000             0.0283495231000000000    0.000
            listDataToConvert.Add("1 Kilogram to Ounce Test", UnitOfMeasure.WeightKilogram, UnitOfMeasure.WeightOunce, 1, 3, 35.274);
            listDataToConvert.Add("1 Ounce to Kilogram Test", UnitOfMeasure.WeightOunce, UnitOfMeasure.WeightKilogram, 1, 10, 0.0283495231);
            listDataToConvert.Add("1 Pound to Ounce Test", UnitOfMeasure.WeightPound, UnitOfMeasure.WeightOunce, 1, 3, 16);
            listDataToConvert.Add("1 Ounce to Pound Test", UnitOfMeasure.WeightOunce, UnitOfMeasure.WeightPound, 1, 4, 0.0625);

            //Weight(Kg)            Gram              g              0.000             0.0010000000000000000    0.000
            listDataToConvert.Add("1 Kilogram to Gram Test", UnitOfMeasure.WeightKilogram, UnitOfMeasure.WeightGram, 1, 3, 1000);
            listDataToConvert.Add("1 Gram to KiloGram Test", UnitOfMeasure.WeightGram, UnitOfMeasure.WeightKilogram, 1, 3, 0.001);
            listDataToConvert.Add("1 Pound to Gram Test", UnitOfMeasure.WeightPound, UnitOfMeasure.WeightGram, 1, 2, 453.59);
            listDataToConvert.Add("1 Gram to Pound Test", UnitOfMeasure.WeightGram, UnitOfMeasure.WeightPound, 1, 7, 0.0022046);
            listDataToConvert.Add("1 Ounce to Gram Test", UnitOfMeasure.WeightOunce, UnitOfMeasure.WeightGram, 1, 2, 28.35);
            listDataToConvert.Add("1 Gram to Ounce Test", UnitOfMeasure.WeightGram, UnitOfMeasure.WeightOunce, 1, 9, 0.0352739620);

            //--------------------- ----------------- -------------- ----------------- ------------------------ -------------------
            // The Common Temperature Calculation is based on the Kelvin
            // UOM Type Name         UOM Name         Abbreviation   PreCalcAddition   Multiplier               PostCalcAddition
            //--------------------- ----------------- -------------- ----------------- ------------------------ -------------------
            //Temperature(K)        Kelvin            K              0.000             1.0000000000000000000    0.000
            listDataToConvert.Add("1 Kelvin to Kelvin Test", UnitOfMeasure.TemperatureKelvin, UnitOfMeasure.TemperatureKelvin, 1, 3, 1);

            //Temperature(K)        Celcius           C              -273.150          1.0000000000000000000    0.000
            listDataToConvert.Add("1 Kelvin to Celcius Test", UnitOfMeasure.TemperatureKelvin, UnitOfMeasure.TemperatureCelsius, 1, 2, -272.15);
            listDataToConvert.Add("1 Celcius to Kelvin Test", UnitOfMeasure.TemperatureCelsius, UnitOfMeasure.TemperatureKelvin, 1, 2, 274.15);
            listDataToConvert.Add("1 Celcius to Celcius Test", UnitOfMeasure.TemperatureCelsius, UnitOfMeasure.TemperatureCelsius, 1, 3, 1);

            //Temperature(K)        Farenheit         F              -273.150          1.8000000000000000000    32.000
            listDataToConvert.Add("1 Kelvin to Farenheit Test", UnitOfMeasure.TemperatureKelvin, UnitOfMeasure.TemperatureFahrenheit, 1, 3, -457.870);
            listDataToConvert.Add("1 Farenheit to Kelvin Test", UnitOfMeasure.TemperatureFahrenheit, UnitOfMeasure.TemperatureKelvin, 1, 5, 255.92778);
            listDataToConvert.Add("1 Celcius to Farenheit Test", UnitOfMeasure.TemperatureCelsius, UnitOfMeasure.TemperatureFahrenheit, 1, 3, 33.800);
            listDataToConvert.Add("1 Farenheit to Celcius Test", UnitOfMeasure.TemperatureFahrenheit, UnitOfMeasure.TemperatureCelsius, 1, 3, -17.222); // done
            listDataToConvert.Add("1 Farenheit to Farenheit Test", UnitOfMeasure.TemperatureFahrenheit, UnitOfMeasure.TemperatureFahrenheit, 1, 3, 1);

            //--------------------- ----------------- -------------- ----------------- ------------------------ -----
            // The Common Length Calculation is based on the Meter
            // UOM Type Name         UOM Name         Abbreviation   PreCalcAddition   Multiplier               PostCalcAddition
            //--------------------- ----------------- -------------- ----------------- ------------------------ -------------------
            //Length(m)             Meter             m              0.000             1.0000000000000000000    0.000
            listDataToConvert.Add("1 Meter to Meter Test", UnitOfMeasure.LengthMeter, UnitOfMeasure.LengthMeter, 1, 3, 1);

            //--------------------- ----------------- -------------- ----------------- ------------------------ -------------------
            // The Common Time Calculation is based on the Second
            // UOM Type Name         UOM Name         Abbreviation   PreCalcAddition   Multiplier               PostCalcAddition
            //--------------------- ----------------- -------------- ----------------- ------------------------ -------------------
            //Time(s)               Second            s              0.000             1.0000000000000000000    0.000
            listDataToConvert.Add("1 Second to Second Test", UnitOfMeasure.TimeSecond, UnitOfMeasure.TimeSecond, 1, 3, 1);

            //Time(s)               Minutes           m              0.000             60.0000000000000000000   0.000
            listDataToConvert.Add("1 Second to Minutes Test", UnitOfMeasure.TimeSecond, UnitOfMeasure.TimeMinutes, 1, 4, 0.0167);
            listDataToConvert.Add("1 Minutes to Second Test", UnitOfMeasure.TimeMinutes, UnitOfMeasure.TimeSecond, 1, 3, 60);
            listDataToConvert.Add("1 Minutes to Minutes Test", UnitOfMeasure.TimeMinutes, UnitOfMeasure.TimeMinutes, 1, 3, 1);

            //Time(s)               Hours             h              0.000             3600.0000000000000000000  0.000
            listDataToConvert.Add("1 Second to Hours Test", UnitOfMeasure.TimeSecond, UnitOfMeasure.TimeHours, 1, 4, 0.0003);
            listDataToConvert.Add("1 Hours to Second Test", UnitOfMeasure.TimeHours, UnitOfMeasure.TimeSecond, 1, 3, 3600);
            listDataToConvert.Add("1 Minutes to Hours Test", UnitOfMeasure.TimeMinutes, UnitOfMeasure.TimeHours, 1, 4, 0.0167);
            listDataToConvert.Add("1 Hours to Minutes Test", UnitOfMeasure.TimeHours, UnitOfMeasure.TimeMinutes, 1, 3, 60);
            listDataToConvert.Add("1 Hours to Hours Test", UnitOfMeasure.TimeHours, UnitOfMeasure.TimeHours, 1, 3, 1);

            //Time(s)               Days              d              0.000             86400.0000000000000000000 0.000
            listDataToConvert.Add("1 Second to Days Test", UnitOfMeasure.TimeSecond, UnitOfMeasure.TimeDays, 1, 8, 0.00001157);
            listDataToConvert.Add("1 Days to Seconds Test", UnitOfMeasure.TimeDays, UnitOfMeasure.TimeSecond, 1, 3, 86400);
            listDataToConvert.Add("1 Minutes to Days Test", UnitOfMeasure.TimeMinutes, UnitOfMeasure.TimeDays, 1, 4, 0.0007);
            listDataToConvert.Add("1 Days to Minutes Test", UnitOfMeasure.TimeDays, UnitOfMeasure.TimeMinutes, 1, 3, 1440);
            listDataToConvert.Add("1 Hours to Days Test", UnitOfMeasure.TimeHours, UnitOfMeasure.TimeDays, 1, 7, 0.0416667);
            listDataToConvert.Add("1 Days to Hours Test", UnitOfMeasure.TimeDays, UnitOfMeasure.TimeHours, 1, 3, 24);
            listDataToConvert.Add("1 Days to Days Test", UnitOfMeasure.TimeDays, UnitOfMeasure.TimeDays, 1, 3, 1);

            //--------------------- ----------------- -------------- ----------------- ------------------------ -------------------
            // The Common Count Calculation is based on the Each
            // UOM Type Name         UOM Name         Abbreviation   PreCalcAddition   Multiplier               PostCalcAddition
            //--------------------- ----------------- -------------- ----------------- ------------------------ -------------------
            //Count(ea)             Each              ea             0.000             1.0000000000000000000    0.000
            listDataToConvert.Add("-1 Each to Each Test", UnitOfMeasure.CountEach, UnitOfMeasure.CountEach, -1, 3, -1);

            //--------------------- ----------------- -------------- ----------------- ------------------------ -------------------
            // The Common Chemistry Calculation is based on the Measured Amount and pH
            // UOM Type Name         UOM Name         Abbreviation   PreCalcAddition   Multiplier               PostCalcAddition
            //--------------------- ----------------- -------------- ----------------- ------------------------ -------------------
            //Chemistry             Measured Amount   Measured       0.000             1.0000000000000000000    0.000
            listDataToConvert.Add("4 Measured Amount to Measured Amount Test", UnitOfMeasure.ChemistryMeasuredAmount, UnitOfMeasure.ChemistryMeasuredAmount, 4, 3, 4);

            //Chemistry             pH                pH             0.000             1.0000000000000000000    0.000
            listDataToConvert.Add("5 PH to PH Test", UnitOfMeasure.ChemistryPh, UnitOfMeasure.ChemistryPh, 5, 3, 5);
            listDataToConvert.Add("1 PH to Measured Amount Test", UnitOfMeasure.ChemistryPh, UnitOfMeasure.ChemistryMeasuredAmount, 1, 3, 1);
            listDataToConvert.Add("1 Measured Amount to PH Test", UnitOfMeasure.ChemistryMeasuredAmount, UnitOfMeasure.ChemistryPh, 1, 3, 1);

            return listDataToConvert;
        }
Example #2
0
 /// <summary>
 /// Update the list of Data to Convert variable to represent invalid conversions
 /// </summary>
 private UomConversionTestDataList GetFailedConvertedDataByMeasurementValues()
 {
     UomConversionTestDataList listDataToConvert = new UomConversionTestDataList();
     listDataToConvert.Add("1 HectoLiter to Fahrenheit Test", UnitOfMeasure.VolumeHectoliter, UnitOfMeasure.TemperatureFahrenheit, 1, 0, 0);
     listDataToConvert.Add("1 Days to Each Test", UnitOfMeasure.TimeDays, UnitOfMeasure.CountEach, 1, 0, 0);
     listDataToConvert.Add("5 PH to US Gallon Test", UnitOfMeasure.ChemistryPh, UnitOfMeasure.VolumeUSGallon, 5, 0, 0);
     return listDataToConvert;
 }