|
|
|
@ -1,13 +1,12 @@
|
|
|
|
|
package com.fanruan.api.util; |
|
|
|
|
|
|
|
|
|
import com.fanruan.api.Prepare; |
|
|
|
|
import com.fr.script.Calculator; |
|
|
|
|
import org.junit.Assert; |
|
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.*; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author richie |
|
|
|
@ -28,9 +27,9 @@ public class RenderKitTest extends Prepare {
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void render() throws Exception{ |
|
|
|
|
String string = new String("a"); |
|
|
|
|
Calculator calculator = new Calculator("b"); |
|
|
|
|
Assert.assertEquals("a", RenderKit.render(string)); |
|
|
|
|
Assert.assertEquals("b", RenderKit.render(calculator)); |
|
|
|
|
Calculator c = Calculator.createCalculator(); |
|
|
|
|
String s = "abc${p1}xyz${p2}"; |
|
|
|
|
Assert.assertEquals("abc1xyz2", RenderKit.render(s,c)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|