Esempio n. 1
0
        static void LimitedIntegerTypesBitwidthCasts(string a, string b, string expected)
        {
            var intA   = (LimitedIntegerType)TestCommon.MakeDataType(DataType.LimitedInteger, a);
            var intB   = (LimitedIntegerType)TestCommon.MakeDataType(DataType.LimitedInteger, b);
            var intExp = (LimitedIntegerType)TestCommon.MakeDataType(DataType.LimitedInteger, expected);

            var actual = (LimitedIntegerType)TestCommon.Operate(null, OperatorType.Add, intA, intB);

            actual.Value.Should().Be(intExp.Value);
            actual.SignAndBitWidth.Should().Be(intExp.SignAndBitWidth);
        }
 public void AllSubtractOperandTypesAreSupported()
 => TestCommon.TestThatAllPossibleOperandTypesAreSupported(_supportedOperatorPairs, (l, r) => TestCommon.Operate(null, OperatorType.Subtract, l, r), "subtracted");
 public void AllModuloOperandTypesAreSupported()
 => TestCommon.TestThatAllPossibleOperandTypesAreSupported(_supportedOperatorPairs, (l, r) => TestCommon.Operate(null, OperatorType.Modulo, l, r), "mod");
Esempio n. 4
0
 public void AllPowerOperandTypesAreSupported()
 => TestCommon.TestThatAllPossibleOperandTypesAreSupported(_supportedOperatorPairs, (l, r) => TestCommon.Operate(null, OperatorType.Power, l, r), "raised to the power of");
 public void AllDivideOperandTypesAreSupported()
 => TestCommon.TestThatAllPossibleOperandTypesAreSupported(_supportedOperatorPairs, (l, r) => TestCommon.Operate(null, OperatorType.Divide, l, r), "divided");
Esempio n. 6
0
 public void AllRootOperandTypesAreSupported()
 => TestCommon.TestThatAllPossibleOperandTypesAreSupported(_supportedOperatorPairs, (l, r) => TestCommon.Operate(null, OperatorType.Root, l, r), "root with index");
 public void AllMultiplyOperandTypesAreSupported()
 => TestCommon.TestThatAllPossibleOperandTypesAreSupported(_supportedOperatorPairs, (l, r) => TestCommon.Operate(null, OperatorType.Multiply, l, r), "multiplied");