?? allmemberssuppliertest.java
字號:
package org.junit.tests.experimental.theories;import static org.hamcrest.CoreMatchers.is;import static org.junit.Assert.assertThat;import java.util.List;import org.junit.Test;import org.junit.experimental.theories.DataPoints;import org.junit.experimental.theories.ParameterSignature;import org.junit.experimental.theories.PotentialAssignment;import org.junit.experimental.theories.internal.AllMembersSupplier;import org.junit.runners.model.TestClass;public class AllMembersSupplierTest { public static class HasDataPoints { @DataPoints public static Object[] objects= { 1, 2 }; public HasDataPoints(Object obj) { } } @Test public void dataPointsAnnotationMeansTreatAsArrayOnly() throws SecurityException, NoSuchMethodException { List<PotentialAssignment> valueSources= new AllMembersSupplier( new TestClass(HasDataPoints.class)) .getValueSources(ParameterSignature.signatures( HasDataPoints.class.getConstructor(Object.class)) .get(0)); assertThat(valueSources.size(), is(2)); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -