Exemplo n.º 1
0
        /// <summary>
        /// Multiplication operation
        /// </summary>
        /// <param name="volumeStream">left factor (multiplicand)</param>
        /// <param name="density">rigth factor (multiplier)</param>
        public static MassStream operator *(VolumeStream volumeStream, Density density)
        {
            // generator : MultiplyAlgebraGenerator.CreateOperator
            // scenario with hint
            // .Is<VolumeStream, Density, MassStream>("*")
            // hint location GetBasicOperatorHints, line 31
            var densityUnit      = density.Unit;
            var tmp1             = densityUnit.CounterUnit;
            var volumeStreamUnit = volumeStream.Unit;
            var targetRightUnit  = new DensityUnit(tmp1, volumeStreamUnit.CounterUnit);
            var resultUnit       = new MassStreamUnit(tmp1, volumeStreamUnit.DenominatorUnit);
            var densityConverted = density.ConvertTo(targetRightUnit);
            var value            = volumeStream.Value * densityConverted.Value;

            return(new MassStream(value, resultUnit));
            // scenario F1
        }
 public bool Equals(MassStreamUnit other)
 {
     return(CounterUnit.Equals(other.CounterUnit) && DenominatorUnit.Equals(other.DenominatorUnit));
 }