コード例 #1
0
        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));
        }
コード例 #2
0
        public void CircularList_Exists_Should_Return_Correct_Answer(int value, int[] values, bool expected)
        {
            bool result = CircularListUtils.Exists(value, values);

            Assert.Equal(expected, result);
        }