public void CanLiftUserDefinedConversionOperator() { S7?a = new S7(42), b = null; Assert.AreEqual((double?)a, 42, "#1"); Assert.IsNull((double?)b, "#2"); }
public void CanLiftUserDefinedBinaryOperator() { S7?a = new S7(42), b = new S7(32), c = null; Assert.AreEqual((a + b).Value.I, 74, "#1"); Assert.IsNull((a + c), "#2"); }
public void CanLiftUserDefinedUnaryOperator() { S7?a = new S7(42), b = null; Assert.AreEqual(-a.Value.I, -42, "#1"); Assert.IsNull(-b, "#2"); }
public void CanLiftUserDefinedUnaryOperator_SPI_1634() { S7?a = new S7(42), b = null; Assert.AreEqual(-42, -a.Value.I, "#1"); // #1634 #SPI Assert.Null(-b, "#2"); }
public void CanLiftUserDefinedConversionOperator_SPI_1611() { S7? a = new S7(42), b = null; double?d1 = null; TestHelper.Safe(() => d1 = (double?)a); Assert.AreEqual(42, d1, "#1"); // #1611 double?d2 = 1; TestHelper.Safe(() => d2 = (double?)b); Assert.Null(d2, "#2"); }