コード例 #1
0
        public void AmountToStandardUnitConverter_InstanceUnit_ReturnsGigaTimesOriginalValue()
        {
            var expected = AmountConverter.ToAmountType(1.0e9);
            var actual   = this.instance.ConvertAmountToStandardUnit(AmountConverter.ToAmountType(1.0));

            AmountAssert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void GetAmount_UsingIUnit_ValidConversion()
        {
            var expected = AmountConverter.ToAmountType(500.0);
            var instance = new Measure <Length>(5.0, Length.Meter);
            var actual   = instance.GetAmount(Length.CentiMeter);

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
ファイル: AmountComparer.cs プロジェクト: softwx/csunits
 static AmountComparer()
 {
     smkEqualityTolerance = AmountConverter.ToAmountType(1.0e-5);
     Instance             = new AmountComparer();
 }