public void TestNumberSwap1UseTempVarCompletehSameNumber() { var x = 2; NumberSwapper1UseTempVarComplete.Swap(ref x, ref x); Assert.AreEqual(2, x); Assert.AreEqual(2, x); }
public void TestNumberSwap1UseTempVarCompletehNegativeAndPositive() { var x = -1; var y = 2; NumberSwapper1UseTempVarComplete.Swap(ref x, ref y); Assert.AreEqual(2, x); Assert.AreEqual(-1, y); }
public void TestNumberSwap1UseTempVarCompleteBothPositive() { var x = 1; var y = 2; NumberSwapper1UseTempVarComplete.Swap(ref x, ref y); Assert.AreEqual(2, x); Assert.AreEqual(1, y); }