package org.slc.sli.modeling.waudit;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

public class WadlExpertTest {

	@Test (expected = RuntimeException.class)
	public void testBogusConstructor() {
		new WadlExpert();
	}
	
	@Test
	public void testIsTemplateParam() {
		assertTrue(WadlExpert.isTemplateParam("{foo}"));
		assertTrue(WadlExpert.isTemplateParam("{}"));
		assertFalse(WadlExpert.isTemplateParam("{"));
		assertFalse(WadlExpert.isTemplateParam("}"));
		assertFalse(WadlExpert.isTemplateParam("}{"));
	}
	
	@Test
	public void testSplitBasedOnFwdSlash() {
		String string = "foo/bar/foo2/bar2";
		
		List<String> expectedResult = new ArrayList<String>();
		expectedResult.add("foo");
		expectedResult.add("bar");
		expectedResult.add("foo2");
		expectedResult.add("bar2");
		
		assertEquals(expectedResult, WadlExpert.splitBasedOnFwdSlash(string));
	}
	
	@Test
	public void testToSteps() {
		
	}




}

@@ -215,34 +215,259 @@
 l.Li
-st;%0A%0Aimport org.junit.Test
+nkedList;%0Aimport java.util.List;%0Aimport java.util.Stack;%0A%0Aimport org.junit.Test;%0Aimport org.slc.sli.modeling.rest.Documentation;%0Aimport org.slc.sli.modeling.rest.Method;%0Aimport org.slc.sli.modeling.rest.Param;%0Aimport org.slc.sli.modeling.rest.Resource
 ;%0A%0Ap
@@ -1247,49 +1247,1171 @@
 %0A%09%0A%09
-@Test%0A%09public void testToSteps() %7B%0A%09%09%0A%09%7D%0A
+private Resource createResource(String path) %7B%0A%09%09String id = %22%22;%0A%09%09List%3CString%3E type = new ArrayList%3CString%3E();%0A%09%09String queryType = %22%22;%0A%09%09List%3CDocumentation%3E doc = new ArrayList%3CDocumentation%3E();%0A%09%09List%3CParam%3E params = new ArrayList%3CParam%3E();%0A%09%09List%3CMethod%3E methods = new ArrayList%3CMethod%3E();%0A%09%09List%3CResource%3E resources = new ArrayList%3CResource%3E();%0A%09%09String resourceClass = %22%22;%0A%09%09%0A%09%09return new Resource(id, type, queryType, path, doc, params, methods, resources, resourceClass);%0A%09%7D%0A%09%0A%09@Test%0A%09public void testToSteps() %7B%0A%09%09%0A%09%09Stack%3CResource%3E ancestors = new Stack%3CResource%3E();%0A%09%09ancestors.push(this.createResource(%22a/b/c%22));%0A%09%09ancestors.push(this.createResource(%22d/e/f%22));%0A%09%09%0A%09%09Resource resource = this.createResource(%22g/h/i%22);%0A%09%09%0A%09%09List%3CString%3E receivedResult = WadlExpert.toSteps(resource, ancestors);%0A%09%09%0A%09%09List%3CString%3E expectedResult = new ArrayList%3CString%3E();%0A%09%09expectedResult.add(%22a%22);%0A%09%09expectedResult.add(%22b%22);%0A%09%09expectedResult.add(%22c%22);%0A%09%09expectedResult.add(%22d%22);%0A%09%09expectedResult.add(%22e%22);%0A%09%09expectedResult.add(%22f%22);%0A%09%09expectedResult.add(%22g%22);%0A%09%09expectedResult.add(%22h%22);%0A%09%09expectedResult.add(%22i%22);%0A%09%09%0A%09%09assertEquals(expectedResult, receivedResult);%0A%09%09%0A%09%7D
 %0A%0A%0A%0A

Add test