public void CreateUomPreferenceGivenPreferenceTypeShouldMapDecimals()
        {
            var preferenceType = new UnitOfMeasurePreferenceType {unitOfMeasure = "m", @decimal = 3};
            var uomPreference = new UnitOfMeasurePreference(preferenceType);

            Assert.AreEqual(3, uomPreference.DecimalPlaces);
        }
        public void CreateUomPreferenceGivenPreferenceTypeShouldMapUnit()
        {
            var preferenceType = new UnitOfMeasurePreferenceType {unitOfMeasure = "m"};
            var uomPreference = new UnitOfMeasurePreference(preferenceType);

            Assert.AreEqual(InternalUnitSystemManager.Instance.UnitOfMeasures["m"], uomPreference.UnitOfMeasure);
        }
 public UnitOfMeasurePreference(UnitOfMeasurePreferenceType unitOfMeasurePreference)
 {
     UnitOfMeasure = InternalUnitSystemManager.Instance.UnitOfMeasures[unitOfMeasurePreference.unitOfMeasure];
     MinValue = unitOfMeasurePreference.minValue;
     MaxValue = unitOfMeasurePreference.maxValue;
     DecimalPlaces = unitOfMeasurePreference.@decimal;
     UnitSystem = GetUnitSystem(unitOfMeasurePreference.unitOfMeasureSystem);
 }
        public void CreateUomPreferenceGivenPreferenceTypeShouldMapUnitSystemType()
        {
            var preferenceType = new UnitOfMeasurePreferenceType
            {
                unitOfMeasureSystem = "umsEnglish"
            };
            var uomPreference = new UnitOfMeasurePreference(preferenceType);

            Assert.AreEqual(Representation.UnitSystem.UnitSystem.umsEnglish, uomPreference.UnitSystem);
        }
 public void CreateUomPreferenceGivenPreferenceTypeShouldMapMinAndMaxValue()
 {
     var preferenceType = new UnitOfMeasurePreferenceType
     {
         unitOfMeasure = "m",
         minValue = 13.2,
         maxValue = 1445.67
     };
     var uomPreference = new UnitOfMeasurePreference(preferenceType);
     Assert.AreEqual(13.2, uomPreference.MinValue);
     Assert.AreEqual(1445.67, uomPreference.MaxValue);
 }