Exemple #1
0
        public void Bonus0()
        {
            e269_BASIC_Formatting c = (e269_BASIC_Formatting)challenge;

            string[] lines = new string[]
            {
                "VAR I",
                "FOR I=1 TO 31",
                "    IF !(I MOD 3) THEN",
                "        PRINT \"FIZZ\"",
                "    ENDIF",
                "    IF !(I MOD 5) THEN",
                "        PRINT \"BUZZ\"",
                "    ENDIF",
                "    IF(I MOD 3) && (I MOD 5) THEN",
                "        PRINT \"FIZZBUZZ\"",
                "    ENDIF",
                "NEXT",
            };

            string[] expected = new string[0];
            string[] actual   = c.CheckForErrors(lines);

            CollectionAssert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void Bonus3()
        {
            e269_BASIC_Formatting c = (e269_BASIC_Formatting)challenge;

            string[] lines = new string[]
            {
                "FOR I=0 TO 10",
                "    PRINT I",
                "ENDIF"
            };

            string[] expected = new string[] { "EXTRA ENDIF", "MISSING NEXT" };
            string[] actual   = c.CheckForErrors(lines);

            CollectionAssert.AreEqual(expected, actual);
        }