public void delTestMethod10() { int[] testArr = new int[] { 0 }; var result = ArrayManipService.DeletePart(testArr, 0); CollectionAssert.AreEqual(result, new int[0]); }
public void delTestMethod11() { int[] testArr = new int[] { 0, 1, 4, 7, 9, 100 }; var result = ArrayManipService.DeletePart(testArr, 7); CollectionAssert.AreEqual(result, testArr); }
public ActionResult <string> Reverse(int[] productIds) { if (productIds == null) { return(Content("")); } //The array is reversed in place ArrayManipService.Reverse(productIds); //Format as string return(Content(string.Format("[{0}]", string.Join(",", productIds)))); }
public ActionResult <string> DeletePart(uint position, int[] productIds) { //since the position provided is 1-based, use (position - 1) for 0-based arrays if (position == 0) { return(Content("")); } var deleted = ArrayManipService.DeletePart(productIds, position - 1); if (deleted == null) { return(Content("")); } //Format as string return(Content(string.Format("[{0}]", string.Join(",", deleted)))); }
public void delTestMethod9() { int[] testArr = new int[] { 0 }; ArrayManipService.DeletePart(testArr, 1); CollectionAssert.AreEqual(testArr, new int[] { 0 }); }
public void delTestMethod8() { int[] testArr = null; ArrayManipService.DeletePart(testArr, 1); CollectionAssert.AreEqual(testArr, null); }
public void reverseTestMethod7() { int[] testArr = new int[] { 4, 2, 3, 1, 5 }; ArrayManipService.Reverse(testArr); CollectionAssert.AreEqual(testArr, new int[] { 5, 1, 3, 2, 4 }); }
public void reverseTestMethod4() { int[] testArr = new int[] { 0, 1, 2, 3 }; ArrayManipService.Reverse(testArr); CollectionAssert.AreEqual(testArr, new int[] { 3, 2, 1, 0 }); }
public void reverseTestMethod1() { int[] testArr = null; ArrayManipService.Reverse(testArr); CollectionAssert.AreEqual(testArr, null); }