Harrison
4 years ago
5 changed files with 68 additions and 14 deletions
@ -0,0 +1,28 @@
|
||||
package com.fr.design.formula; |
||||
|
||||
import com.fr.base.BaseFormula; |
||||
import org.junit.Assert; |
||||
import org.junit.Test; |
||||
|
||||
import static org.junit.Assert.*; |
||||
|
||||
public class FormulaTextFieldTest { |
||||
|
||||
@Test |
||||
public void testSet() { |
||||
|
||||
FormulaTextField field = new FormulaTextField(); |
||||
BaseFormula aaaa = BaseFormula.createFormulaBuilder().build("aaaa"); |
||||
field.setValueAndText(aaaa, true); |
||||
|
||||
Assert.assertEquals("aaaa", field.getText()); |
||||
|
||||
field.setValueAndText(aaaa, false); |
||||
Assert.assertEquals("=aaaa", field.getText()); |
||||
|
||||
field.setText("bbbb"); |
||||
BaseFormula formula = field.getValue(); |
||||
Assert.assertEquals("bbbb", formula.getPureContent()); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue