package de.morphbit.thymeleaf.parser;

import static org.junit.Assert.assertTrue;

import java.util.Set;

import org.junit.Test;

import de.morphbit.thymeleaf.model.ThymeleafComponent;

public class StandardThymeleafComponentParserTest {

	@Test
	public void testParser() {
		final StandardThymeleafComponentParser parser =
		        new StandardThymeleafComponentParser("templates/", ".html",
		            "components");
		Set<ThymeleafComponent> components = parser.parse();
		assertTrue(!components.isEmpty());
		assertTrue(containsComponent(components, "link"));
	}

	private boolean containsComponent(final Set<ThymeleafComponent> components,
	        final String name) {
		for (ThymeleafComponent component : components) {
			if (component.getName().equalsIgnoreCase(name)) {
				return true;
			}
		}
		return false;
	}
}

@@ -561,16 +561,262 @@
 ink%22));%0A
+%09%09assertTrue(containsComponent(components, %22link-named%22));%0A%09%09assertTrue(notContainsComponent(components, %22link2%22));%0A%09%09assertTrue(notContainsComponent(components, %22no-component%22));%0A%09%09assertTrue(notContainsComponent(components, %22link-component%22));%0A
 %09%7D%0A%0A%09pri
@@ -1067,11 +1067,173 @@
 alse;%0A%09%7D
+%0A%0A%09private boolean notContainsComponent(%0A%09        final Set%3CThymeleafComponent%3E components, final String name) %7B%0A%09%09return !containsComponent(components, name);%0A%09%7D
 %0A%7D%0A

Add assertions