public static void EnsureIncrementDecrementNegation <T>(bool expectedValue) { UnaryOperationHelper.SupportsIncrement <T>().ShouldBe(expectedValue); UnaryOperationHelper.SupportsDecrement <T>().ShouldBe(expectedValue); UnaryOperationHelper.SupportsNegation <T>().ShouldBe(expectedValue); UnaryOperationHelper.SupportsIncrement <T>().ShouldBe(expectedValue); UnaryOperationHelper.SupportsCheckedNegation <T>().ShouldBe(expectedValue); }
public void ShouldProperlyDetectPartialUnaryOperationImplementation() { UnaryOperationHelper.SupportsIncrement <PartiallyUnarySupportedNumber>().ShouldBeTrue(); UnaryOperationHelper.SupportsDecrement <PartiallyUnarySupportedNumber>().ShouldBeFalse(); UnaryOperationHelper.SupportsNegation <PartiallyUnarySupportedNumber>().ShouldBeFalse(); UnaryOperationHelper.SupportsOnesCompliment <PartiallyUnarySupportedNumber>().ShouldBeTrue(); UnaryOperationHelper.SupportsUnaryPlus <PartiallyUnarySupportedNumber>().ShouldBeFalse(); }
public void UnaryOperationOnInvalidTypeShouldNotBeSupported() { EnsureIncrementDecrementNegation <object>(false); UnaryOperationHelper.SupportsOnesCompliment <object>().ShouldBeFalse(); }
public void UnaryOperationOnBigIntegerShouldBeSupported() { EnsureIncrementDecrementNegation <BigInteger>(true); UnaryOperationHelper.SupportsOnesCompliment <BigInteger>().ShouldBeTrue(); }
public void UnaryOperationOnDecimalShouldBeSupported() { EnsureIncrementDecrementNegation <decimal>(true); UnaryOperationHelper.SupportsOnesCompliment <decimal>().ShouldBeFalse(); }
public void UnaryOperationOnShortShouldBeSupported() { EnsureIncrementDecrementNegation <short>(true); UnaryOperationHelper.SupportsOnesCompliment <short>().ShouldBeTrue(); }