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");
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");
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");