public void GivenBaseNumberWhenAddBaseNumberToSourceThenShouldAddTheSecondNumberToSourceValue() { var firstNumber = new NumericValue(_mileUnitOfMeasure.ToModelUom(), 42.24); var secondNumber = new NumericValue(_mileUnitOfMeasure.ToModelUom(), 12.34); firstNumber.AddToSource(secondNumber); Assert.AreEqual(54.58, firstNumber.Value, Epsilon); }
public void GivenTwoVariableNumbersWhenAddedThenRepresentationIsOriginal() { var originalUom = _ftUnitOfMeasure.ToModelUom(); var originalValue = new NumericValue(originalUom, 22); var originalNumber = new NumericRepresentationValue(RepresentationInstanceList.vrDistanceTraveled.ToModelRepresentation(), originalValue); var secondUom = InternalUnitSystemManager.Instance.UnitOfMeasures["m"].ToModelUom(); var secondValue = new NumericValue(secondUom, 11); var secondNumber = new NumericRepresentationValue(RepresentationInstanceList.vrElevation.ToModelRepresentation(), secondValue); var result = originalNumber.Add(secondNumber); Assert.AreSame(RepresentationInstanceList.vrDistanceTraveled.DomainId, result.Representation.Code); }