コード例 #1
0
        public void Modulo3FilterTestSimple()
        {
            int[] input    = { 7, 2, 8, 3, 9, 4, 10, 5, 11, 6 };
            int[] expected = Modulo3Filter.modulo3s(input);
            int[] output   = { 1, 2, 2, 0, 0, 1, 1, 2, 2, 0 };

            CollectionAssert.AreEqual(expected, output);
        }
コード例 #2
0
        public void Modulo3FilterTestIntermediate()
        {
            int[] input    = { 0, 1220, -20 };
            int[] expected = Modulo3Filter.modulo3s(input);
            int[] output   = { 0, 2, -2 };

            CollectionAssert.AreEqual(expected, output);
        }
コード例 #3
0
 public static int[] combinedFilter(int[] xs)
 {
     return(RunningTotal.adder(Modulo3Filter.modulo3s(xs)));
 }