当前位置: 首页>>代码示例>>Java>>正文


Java TestedOn类代码示例

本文整理汇总了Java中org.junit.experimental.theories.suppliers.TestedOn的典型用法代码示例。如果您正苦于以下问题:Java TestedOn类的具体用法?Java TestedOn怎么用?Java TestedOn使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TestedOn类属于org.junit.experimental.theories.suppliers包,在下文中一共展示了TestedOn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: appendedDoubleWithPrecisionParsesAsItselfWithTolerance

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
@Theory( nullsAccepted = false )
public void appendedDoubleWithPrecisionParsesAsItselfWithTolerance( final Double value,
                                                                    @TestedOn( ints = { 0, 1, 2, 3, 10, 16, 19, 20 } )
                                                                    final int digits ) {
	final ByteBuffer buffer = ByteBuffer.allocate( 50 );
	BufferFormatter.append( buffer, value, digits );
	final String formatted = BufferFormatterTest.toString( buffer );

	final double parsedValue = Double.parseDouble( formatted );

	assertThat(
			".append(" + value + "," + digits + ") -> [" + formatted + "] -> [" + parsedValue + "]",
			parsedValue,
			closeTo( value, tolerance( digits ) )
	);
}
 
开发者ID:vladimirdolzhenko,项目名称:gflogger,代码行数:17,代码来源:BufferFormatterPropertyTest.java

示例2: appendedDoubleWithPrecisionParsesAsItselfWithToleranceCB

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
@Theory( nullsAccepted = false )
public void appendedDoubleWithPrecisionParsesAsItselfWithToleranceCB( final Double value,
                                                                      @TestedOn( ints = { 0, 1, 2, 3, 10, 16, 19, 20 } )
                                                                      final int digits ) {
	final CharBuffer buffer = CharBuffer.allocate( 50 );
	BufferFormatter.append( buffer, value, digits );
	final String formatted = BufferFormatterTest.toString( buffer );

	final double parsedValue = Double.parseDouble( formatted );

	assertThat(
			".append(" + value + "," + digits + ") -> [" + formatted + "] -> [" + parsedValue + "]",
			parsedValue,
			closeTo( value, tolerance( digits ) )
	);
}
 
开发者ID:vladimirdolzhenko,项目名称:gflogger,代码行数:17,代码来源:BufferFormatterPropertyTest.java

示例3: testNotExistChars

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
@Theory
public void testNotExistChars(@TestedOn(ints = { 5, 50, 500 }) int count) {
  StringBuilder sb = new StringBuilder();
  IntStream.range(0, count)
      .mapToObj(a -> (char) (Math.random() * 100 + 128))
      .forEach(sb::append);
  String string = sb.toString();
  Flowable.fromIterable(() -> notExistChars(string))
      .test(0)
      .requestMore(count)
      .assertNever(c -> string.indexOf(c.charValue()) != -1);
}
 
开发者ID:XDean,项目名称:Java-EX,代码行数:13,代码来源:StringUtilTest.java

示例4: getAnnotations

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
@Test
public void getAnnotations() throws SecurityException,
        NoSuchMethodException {
    Method method = getClass().getMethod("foo", int.class);
    List<Annotation> annotations = ParameterSignature.signatures(method)
            .get(0).getAnnotations();
    assertThat(annotations,
            CoreMatchers.<TestedOn>hasItem(isA(TestedOn.class)));
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:10,代码来源:ParameterSignatureTest.java

示例5: getAnnotations

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
@Test
public void getAnnotations() throws SecurityException,
        NoSuchMethodException {
    Method method = ParameterSignatureTest.class.getMethod("foo", int.class);
    List<Annotation> annotations = ParameterSignature.signatures(method)
            .get(0).getAnnotations();
    assertThat(annotations,
            CoreMatchers.<TestedOn>hasItem(isA(TestedOn.class)));
}
 
开发者ID:MattiasBuelens,项目名称:junit,代码行数:10,代码来源:ParameterSignatureTest.java

示例6: testLeading

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
@Theory public void testLeading(@TestedOn(ints = {WIDTH_DP_L, WIDTH_DP_M}) int widthDp,
                                @NonNull FontScale fontScale,
                                @TestedOn(ints = {1, 2}) int leadingScalar) {
    final String str = StringUtils.repeat("Mm%[email protected]|Pbdpqg ", 100);
    setUp(widthDp, LayoutDirection.LOCALE, fontScale, Theme.LIGHT, str, leadingScalar);
    snap(textView, leadingScalar + "x_leading");
}
 
开发者ID:wikimedia,项目名称:apps-android-wikipedia,代码行数:8,代码来源:LeadingSpanTest.java

示例7: testWidth

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
@Theory public void testWidth(@TestedOn(ints = {WIDTH_DP_L, WIDTH_DP_M}) int widthDp,
                              @NonNull FontScale fontScale, @NonNull PrimaryTestImg image,
                              @NonNull PrimaryTestStr title, @NonNull SecondaryTestStr subtitle) {
    setUp(widthDp, LayoutDirection.LOCALE, fontScale, Theme.LIGHT, image, title, subtitle,
            BLUE);
    snap(subject, image + "_image", title + "_title", subtitle + "_subtitle");
}
 
开发者ID:wikimedia,项目名称:apps-android-wikipedia,代码行数:8,代码来源:CardHeaderViewTest.java

示例8: testWidth

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
@Theory public void testWidth(@TestedOn(ints = {WIDTH_DP_L, WIDTH_DP_M}) int widthDp,
                              @NonNull FontScale fontScale, @NonNull PrimaryTestStr title,
                              @NonNull SecondaryTestStr subtitle,
                              @TestedOn(ints = {0, 1, MAX_SUGGESTIONS}) int suggestions) {
    setUp(widthDp, LayoutDirection.LOCALE, fontScale, Theme.LIGHT, title, subtitle, TODAY,
            suggestions);
    snap(subject, title + "_title", subtitle + "_subtitle", suggestions + "_suggestions");
}
 
开发者ID:wikimedia,项目名称:apps-android-wikipedia,代码行数:9,代码来源:BecauseYouReadCardViewTest.java

示例9: testSetSubtitle

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
@Theory public void testSetSubtitle(@TestedOn(ints = {TODAY, TOMORROW, 2}) int age) {
    setUp(WIDTH_DP_L, LayoutDirection.LOCALE, FontScale.DEFAULT, Theme.LIGHT,
            PrimaryTestStr.SHORT, SecondaryTestStr.SHORT, TODAY, MAX_SUGGESTIONS);

    String expected;
    switch (age) {
        case TODAY: expected = "Today"; break;
        case TOMORROW: expected = "Yesterday"; break;
        default: expected = String.valueOf(age);
    }

    String subtitle = subject.getSubtitle(age);
    assertThat(subtitle, containsString(expected));
}
 
开发者ID:wikimedia,项目名称:apps-android-wikipedia,代码行数:15,代码来源:BecauseYouReadCardViewTest.java

示例10: testWidth

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
@Theory public void testWidth(@TestedOn(ints = {WIDTH_DP_XL, WIDTH_DP_L}) int widthDp,
                              @NonNull FontScale fontScale, @NonNull PrimaryTestStr title,
                              @NonNull SecondaryTestStr description,
                              @NonNull PrimaryTestStr error, @TestedOnBool boolean saving) {
    setUp(widthDp, LayoutDirection.LOCALE, fontScale, Theme.LIGHT, title, description, error,
            saving);
    snap(subject, title + "_title", description + "_description", error + "_error",
            saving ? "saving" : "unsaved");
}
 
开发者ID:wikimedia,项目名称:apps-android-wikipedia,代码行数:10,代码来源:DescriptionEditViewTest.java

示例11: testLayout

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
@Theory public void testLayout(@TestedOn(ints = {WIDTH_DP_L, WIDTH_DP_M}) int widthDp,
                               // @TestedOn(ints = {HEIGHT_DP_L, WIDTH_DP_S}) int heightDp,
                               @NonNull FontScale fontScale, @NonNull PrimaryTestImg image,
                               @NonNull PrimaryTestStr title, @NonNull SecondaryTestStr subtitle,
                               @TestedOnBool boolean pronunciation) {
    // todo: pass height when layout is correct
    setUp(widthDp, 0, LayoutDirection.LOCALE, fontScale, Theme.LIGHT, image, title,
            subtitle, pronunciation);
    snap(subject, image + "_image", title + "_title", subtitle + "_subtitle",
            pronunciation ? "pronunciation" : "no_pronunciation");
}
 
开发者ID:wikimedia,项目名称:apps-android-wikipedia,代码行数:12,代码来源:PageHeaderViewTest.java

示例12: testOnScrollChanged

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
@Theory public void testOnScrollChanged(@TestedOn(ints = {-1, 0, 1}) int y) {
    setUpTypical();

    // width and height must be > 0 for Bitmap.createBitmap()
    final int height = 100;
    ViewHelpers.setupView(subject).setExactHeightDp(height).layout();

    subject.onScrollChanged(0, y, false);
    assertThat((int) subject.getTranslationY(), is(-Math.min(height, y)));
    assertThat((int) subject.image.getImage().getTranslationY(), is(y / 2));
}
 
开发者ID:wikimedia,项目名称:apps-android-wikipedia,代码行数:12,代码来源:PageHeaderViewTest.java

示例13: foo

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
public void foo(@TestedOn(ints = {1, 2, 3}) int x) {
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:3,代码来源:ParameterSignatureTest.java

示例14: foo

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
public void foo(@TestedOn(ints = {1}) int x) {
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:3,代码来源:TestedOnSupplierTest.java

示例15: everythingIsOne

import org.junit.experimental.theories.suppliers.TestedOn; //导入依赖的package包/类
@Theory
public void everythingIsOne(@TestedOn(ints = {1})
int number) {
    assertThat(number, is(1));
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:6,代码来源:WithExtendedParameterSources.java


注:本文中的org.junit.experimental.theories.suppliers.TestedOn类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。