Esempio n. 1
0
            public void WillColorizeAKeywordWithNoSurroundingText(string keyword)
            {
                var source    = keyword;
                var exepected = AcceptanceHelper.BuildExpected(@"<span style=""color:Blue;"">{0}</span>", keyword);

                var actual = new CodeColorizer().Colorize(source, Languages.Java);

                Assert.Equal(exepected, actual);
            }
Esempio n. 2
0
            public void WillColorizeAKeywordWithPrecedingAndSucceedingText(string keyword)
            {
                var source    = string.Format("fnord {0} fnord", keyword);
                var exepected = AcceptanceHelper.BuildExpected(@"fnord <span style=""color:Blue;"">{0}</span> fnord", keyword);

                var actual = new CodeColorizer().Colorize(source, Languages.Java);

                Assert.Equal(exepected, actual);
            }
Esempio n. 3
0
            public void WillColorizeCharacters()
            {
                const string source   = @"char aChar = 'a';";
                var          expected = AcceptanceHelper.BuildExpected(@"<span style=""color:Blue;"">char</span> aChar = <span style=""color:#A31515;"">&#39;a&#39;</span>;");

                var actual = new CodeColorizer().Colorize(source, Languages.Java);

                Assert.Equal(expected, actual);
            }
Esempio n. 4
0
            public void WillColorizeStrings()
            {
                const string source   = @"string aString = ""aString"";";
                var          expected = AcceptanceHelper.BuildExpected(@"string aString = <span style=""color:#A31515;"">&quot;aString&quot;</span>;");

                var actual = new CodeColorizer().Colorize(source, Languages.Java);

                Assert.Equal(expected, actual);
            }
Esempio n. 5
0
            public void WillColorizeASingleLineStyleComment()
            {
                const string source   = @"//comment";
                var          expected = AcceptanceHelper.BuildExpected(@"<span style=""color:Green;"">//comment</span>");

                var actual = new CodeColorizer().Colorize(source, Languages.Java);

                Assert.Equal(expected, actual);
            }
Esempio n. 6
0
            public void WillNotColorizeAKeywordInsideAWord(string keyword)
            {
                var source    = string.Format("fnord{0}fnord", keyword);
                var exepected = AcceptanceHelper.BuildExpected(@"fnord{0}fnord", keyword);

                var actual = new CodeColorizer().Colorize(source, Languages.Java);

                Assert.Equal(exepected, actual);
            }
            public void WillColorizeAMultieLineStyleCommentOnOneLine()
            {
                const string source   = @"/*comment*/";
                var          expected = AcceptanceHelper.BuildExpected(@"<span style=""color:Green;"">/*comment*/</span>");

                var actual = new CodeColorizer().Colorize(source, Languages.Cpp);

                Assert.Equal(expected, actual);
            }