" width: 125px;\n" +
" }\n" +
" </style>";
TagReader s = new TagReader(text);
assertEquals(s.getAllElements(Tags.SCRIPT).size(), 2);
Element firstScript = s.getAllElements(Tags.SCRIPT).get(0);
Element secondScript = s.getAllElements(Tags.SCRIPT).get(1);
assertEquals(firstScript.isContentExists(), true);
assertEquals(secondScript.isContentExists(), true);
assertEquals(firstScript.getContentAsString(), "");
assertEquals(secondScript.getContentAsString(), "\n" +
" goog.require('goog.events');\n" +
" goog.require('goog.fx');\n" +
" goog.require('goog.fx.dom');\n" + " ");
assertEquals(firstScript.getAttributes().isValueExists("src"), true);
assertEquals(secondScript.getAttributes().isValueExists("src"), false);
assertEquals(firstScript.getAttributes().getValue("src"), "js/closure/goog/base.js");
Element link = s.getAllElements(Tags.LINK).get(0);
assertEquals(link.getAttributes().getValue("REL"), "stylesheet");
assertEquals(link.getAttributes().get("ReL").getBegin(), text.indexOf("rel="));
assertEquals(link.getAttributes().get("ReL").getEnd(), text.indexOf("stylesheet") + "stylesheet\"".length());
Element style = s.getAllElements(Tags.STYLE).get(0);
assertEquals(style.getBegin(), text.indexOf("<style>"));
assertEquals(style.getEnd(), text.indexOf("</style>") + "</style>".length());
assertEquals(style.getContentBegin(), text.indexOf("<style>") + "<style>".length());
assertEquals(style.getContentEnd(), text.indexOf("</style>"));
}