Ejemplo n.º 1
0
        public void StandardMeasureIndexer_ReciprocalCentiMeter_ReturnsHundredthValue()
        {
            var expected = new Measure <WaveNumber>(amount: 1.0, unit: WaveNumber.ReciprocalCentiMeter);
            var actual   = new WaveNumber(amount: 100.0)[WaveNumber.ReciprocalCentiMeter];

            MeasureAssert.MeasuresAreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void From_FloatAndVolumeUnit_ReturnsStandardVolumeMeasure()
        {
            var expected = new Measure <Volume>(0.002f, Volume.CubicMeter);
            var actual   = 2.0f.From(Volume.Liter);

            MeasureAssert.MeasuresAreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void To_DecimalAndLengthUnit_ReturnsMeasureInSpecifiedAmountAndUnit()
        {
            var expected = new Measure <Length>(3.0m, Length.MilliMeter);
            var actual   = 3.0m.To(Length.MilliMeter);

            MeasureAssert.MeasuresAreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void ToStandardMeasures_DecimalWithUnitConversion_ReturningConvertedStandardMeasures()
        {
            var measures = new[] { 1.0m, 2.0m, 3.0m, -2.0m }.Cast(ElectricCurrent.MilliAmpere);
            var expected = new ElectricCurrent(0.002m);
            var actual   = measures.ElementAt(1);

            MeasureAssert.MeasuresAreEqual(expected, actual);
        }
Ejemplo n.º 5
0
        public void ToStandardMeasures_DoubleNoUnitConversion_ReturningNonConvertedStandardMeasures()
        {
            var measures = new[] { 1.0, 2.0, 3.0, -2.0 }.Cast <Length>();
            var expected = new Length(3.0);
            var actual   = measures.ElementAt(2);

            MeasureAssert.MeasuresAreEqual(expected, actual);
        }