public JsonResult OnPost(string circularListString, int numberToFind) { string[] splitted = circularListString.Split(','); int[] myInts = Array.ConvertAll(splitted, s => int.Parse(s)); bool result = CircularListUtils.Exists(numberToFind, myInts); return(new JsonResult(result)); }
public void CircularList_Exists_Should_Return_Correct_Answer(int value, int[] values, bool expected) { bool result = CircularListUtils.Exists(value, values); Assert.Equal(expected, result); }