Пример #1
0
        public void CreateUomPreferenceGivenPreferenceTypeShouldMapDecimals()
        {
            var preferenceType = new UnitOfMeasurePreferenceType {
                unitOfMeasure = "m", @decimal = 3
            };
            var uomPreference = new UnitOfMeasurePreference(preferenceType);

            Assert.AreEqual(3, uomPreference.DecimalPlaces);
        }
Пример #2
0
        public void CreateUomPreferenceGivenPreferenceTypeShouldMapUnit()
        {
            var preferenceType = new UnitOfMeasurePreferenceType {
                unitOfMeasure = "m"
            };
            var uomPreference = new UnitOfMeasurePreference(preferenceType);

            Assert.AreEqual(InternalUnitSystemManager.Instance.UnitOfMeasures["m"], uomPreference.UnitOfMeasure);
        }
Пример #3
0
        public void CreateUomPreferenceGivenPreferenceTypeShouldMapUnitSystemType()
        {
            var preferenceType = new UnitOfMeasurePreferenceType
            {
                unitOfMeasureSystem = "umsEnglish"
            };
            var uomPreference = new UnitOfMeasurePreference(preferenceType);

            Assert.AreEqual(Representation.UnitSystem.UnitSystem.umsEnglish, uomPreference.UnitSystem);
        }
Пример #4
0
        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);
        }