예제 #1
0
 public static bool AreEquals(this DimensionInformation left, DimensionInformation right)
 {
     return(left.LengthExponent == right.LengthExponent &&
            left.MassExponent == right.MassExponent &&
            left.TimeExponent == right.TimeExponent &&
            left.ElectricCurrentExponent == right.ElectricCurrentExponent &&
            left.TemperatureExponent == right.TemperatureExponent &&
            left.AmountExponent == right.AmountExponent &&
            left.LuminousIntensityExponent == right.LuminousIntensityExponent);
 }
예제 #2
0
        public void should_return_correct_parsed_dimension(string formula,
                                                           double lengthExponent, double massExponent, double timeExponent,
                                                           double electricCurrentExponent, double temperatureExponent, double amountExponent,
                                                           double luminousIntensityExponent)
        {
            var(dimension, parseSuccess, calculateDimensionSuccess, _) =
                sut.GetDimensionInformationFor(formula, _quantityDimensionInfos);

            parseSuccess.ShouldBeTrue();
            calculateDimensionSuccess.ShouldBeTrue();

            var returnedDimension = new DimensionInformation(lengthExponent, massExponent, timeExponent,
                                                             electricCurrentExponent, temperatureExponent, amountExponent, luminousIntensityExponent);

            dimension.Equals(returnedDimension).ShouldBeTrue();
        }