Beispiel #1
0
 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);
 }
Beispiel #2
0
 public void ShouldProperlyDetectPartialUnaryOperationImplementation()
 {
     UnaryOperationHelper.SupportsIncrement <PartiallyUnarySupportedNumber>().ShouldBeTrue();
     UnaryOperationHelper.SupportsDecrement <PartiallyUnarySupportedNumber>().ShouldBeFalse();
     UnaryOperationHelper.SupportsNegation <PartiallyUnarySupportedNumber>().ShouldBeFalse();
     UnaryOperationHelper.SupportsOnesCompliment <PartiallyUnarySupportedNumber>().ShouldBeTrue();
     UnaryOperationHelper.SupportsUnaryPlus <PartiallyUnarySupportedNumber>().ShouldBeFalse();
 }
Beispiel #3
0
 public void UnaryOperationOnInvalidTypeShouldNotBeSupported()
 {
     EnsureIncrementDecrementNegation <object>(false);
     UnaryOperationHelper.SupportsOnesCompliment <object>().ShouldBeFalse();
 }
Beispiel #4
0
 public void UnaryOperationOnBigIntegerShouldBeSupported()
 {
     EnsureIncrementDecrementNegation <BigInteger>(true);
     UnaryOperationHelper.SupportsOnesCompliment <BigInteger>().ShouldBeTrue();
 }
Beispiel #5
0
 public void UnaryOperationOnDecimalShouldBeSupported()
 {
     EnsureIncrementDecrementNegation <decimal>(true);
     UnaryOperationHelper.SupportsOnesCompliment <decimal>().ShouldBeFalse();
 }
Beispiel #6
0
 public void UnaryOperationOnShortShouldBeSupported()
 {
     EnsureIncrementDecrementNegation <short>(true);
     UnaryOperationHelper.SupportsOnesCompliment <short>().ShouldBeTrue();
 }