• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java StandardComparisonStrategy类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: should_fail_if_arrays_have_different_sizes_for_large_arrays

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
@Test
public void should_fail_if_arrays_have_different_sizes_for_large_arrays() {
  // GIVEN
  Object[] actual = new Object[2000];
  Object[] expected = new Object[actual.length + 1];
  for (int i = 0; i < actual.length; i++) {
    actual[i] = String.valueOf(i);
    expected[i] = String.valueOf(i);
  }
  expected[actual.length] = "extra";
  AssertionInfo info = someInfo();
  // WHEN
  try {
    arrays.assertContainsExactly(info, actual, expected);
  } catch (AssertionError e) {
    // THEN
    verify(failures).failure(info, shouldContainExactly(actual, asList(expected),
                                                        newArrayList("extra"), newArrayList(),
                                                        StandardComparisonStrategy.instance()));
    return;
  }
  failBecauseExpectedAssertionErrorWasNotThrown();
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:24,代码来源:ObjectArrays_assertContainsExactly_Test.java


示例2: should_create_error_message

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
@Test
public void should_create_error_message() {
  ErrorMessageFactory factory = shouldNotContain("Yoda", "od", StandardComparisonStrategy.instance());
  String message = factory.create(new TextDescription("Test"), STANDARD_REPRESENTATION);
  assertThat(message).isEqualTo(format("[Test] %n" +
                                       "Expecting:%n" +
                                       " <\"Yoda\">%n" +
                                       "not to contain:%n" +
                                       " <\"od\">%n"));
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:11,代码来源:ShouldNotContainString_create_Test.java


示例3: should_create_error_message_with_several_string_values

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
@Test
public void should_create_error_message_with_several_string_values() {
  ErrorMessageFactory factory = shouldNotContain("Yoda", array("od", "ya"), newSet("ya"),
                                                 StandardComparisonStrategy.instance());
  String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
  assertThat(message).isEqualTo(format("[Test] %n" +
                                       "Expecting:%n" +
                                       " <\"Yoda\">%n" +
                                       "not to contain:%n" +
                                       " <[\"od\", \"ya\"]>%n" +
                                       "but found:%n" +
                                       " <[\"ya\"]>%n"));
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:14,代码来源:ShouldNotContainString_create_Test.java


示例4: should_create_error_message

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
@Test
public void should_create_error_message() {
  ErrorMessageFactory factory = shouldBeSubstring("bcd", "abcdef", StandardComparisonStrategy.instance());
  String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
  assertThat(message).isEqualTo(format("[Test] %n" +
                                       "Expecting:%n" +
                                       "  <\"bcd\">%n" +
                                       "to be a substring of:%n" +
                                       "  <\"abcdef\">%n"));
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:11,代码来源:ShouldBeSubstringOf_create_Test.java


示例5: should_fail_if_actual_does_not_contain_given_values_exactly

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
@Test
public void should_fail_if_actual_does_not_contain_given_values_exactly() {
  AssertionInfo info = someInfo();
  Object[] expected = { "Luke", "Yoda", "Han" };
  try {
    iterables.assertContainsExactlyInAnyOrder(info, actual, expected);
  } catch (AssertionError e) {
    verify(failures).failure(info,
        shouldContainExactlyInAnyOrder(actual, expected, newArrayList("Han"), newArrayList("Leia"), StandardComparisonStrategy.instance()));
    return;
  }
  failBecauseExpectedAssertionErrorWasNotThrown();
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:14,代码来源:Iterables_assertContainsExactlyInAnyOrder_Test.java


示例6: should_fail_if_actual_contains_duplicates_and_expected_does_not

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
@Test
public void should_fail_if_actual_contains_duplicates_and_expected_does_not() {
  AssertionInfo info = someInfo();
  actual = newArrayList("Luke", "Leia", "Luke");
  Object[] expected = { "Luke", "Leia" };
  try {
    iterables.assertContainsExactlyInAnyOrder(info, actual, expected);
  } catch (AssertionError e) {
    verify(failures).failure(info,
        shouldContainExactlyInAnyOrder(actual, expected, emptyList(), newArrayList("Luke"), StandardComparisonStrategy.instance()));
    return;
  }
  failBecauseExpectedAssertionErrorWasNotThrown();
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:15,代码来源:Iterables_assertContainsExactlyInAnyOrder_Test.java


示例7: should_fail_if_expected_contains_duplicates_and_actual_does_not

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
@Test
public void should_fail_if_expected_contains_duplicates_and_actual_does_not() {
  AssertionInfo info = someInfo();
  actual = newArrayList("Luke", "Leia");
  Object[] expected = { "Luke", "Leia", "Luke"};
  try {
    iterables.assertContainsExactlyInAnyOrder(info, actual, expected);
  } catch (AssertionError e) {
    verify(failures).failure(info,
        shouldContainExactlyInAnyOrder(actual, expected, newArrayList("Luke"), emptyList(), StandardComparisonStrategy.instance()));
    return;
  }
  failBecauseExpectedAssertionErrorWasNotThrown();
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:15,代码来源:Iterables_assertContainsExactlyInAnyOrder_Test.java


示例8: should_fail_if_actual_contains_any_of_given_values

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
@Test
public void should_fail_if_actual_contains_any_of_given_values() {
  String[] values = { "practice", "make", "good" };
  thrown.expectAssertionError(shouldNotContain("Practice makes perfect", values, newSet("make"),
                                               StandardComparisonStrategy.instance()));
  strings.assertDoesNotContain(someInfo(), "Practice makes perfect", values);
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:8,代码来源:Strings_assertDoesNotContain_Test.java


示例9: should_fail_if_actual_contains_all_given_values_but_size_differ

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
@Test
public void should_fail_if_actual_contains_all_given_values_but_size_differ() {
  AssertionInfo info = someInfo();
  actual = array("Luke", "Leia", "Luke");
  Object[] expected = { "Luke", "Leia" };
  try {
    arrays.assertContainsExactly(info, actual, expected);
  } catch (AssertionError e) {
    verify(failures).failure(info, shouldContainExactly(actual, asList(expected),
                                                        newArrayList(), newArrayList("Luke"),
                                                        StandardComparisonStrategy.instance()));
    return;
  }
  failBecauseExpectedAssertionErrorWasNotThrown();
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:16,代码来源:ObjectArrays_assertContainsExactly_Test.java


示例10: AbstractOptionAssert

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
AbstractOptionAssert(Option<VALUE> actual, Class<?> selfType) {
    super(actual, selfType);
    this.optionValueComparisonStrategy = StandardComparisonStrategy.instance();
}
 
开发者ID:assertj,项目名称:assertj-vavr,代码行数:5,代码来源:AbstractOptionAssert.java


示例11: AbstractTryAssert

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
AbstractTryAssert(Try<VALUE> actual, Class<?> selfType) {
    super(actual, selfType);
    this.TryValueComparisonStrategy = StandardComparisonStrategy.instance();
}
 
开发者ID:assertj,项目名称:assertj-vavr,代码行数:5,代码来源:AbstractTryAssert.java


示例12: AbstractCompletionStageAssert

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
protected AbstractCompletionStageAssert(CompletionStage<T> actual, Class<?> selfType, Duration timeout) {
    super(actual.toCompletableFuture(), selfType);
    this.timeout = timeout;
    this.optionalValueComparisonStrategy = StandardComparisonStrategy.instance();
}
 
开发者ID:Tradeshift,项目名称:ts-reaktive,代码行数:6,代码来源:AbstractCompletionStageAssert.java


示例13: FDatesAssertions

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
@VisibleForTesting
FDatesAssertions() {
    this(StandardComparisonStrategy.instance());
}
 
开发者ID:subes,项目名称:invesdwin-util,代码行数:5,代码来源:FDatesAssertions.java


示例14: shouldContainAnyOf

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
public static ErrorMessageFactory shouldContainAnyOf(Object actual, Object expected) {
  return shouldContainAnyOf(actual, expected, StandardComparisonStrategy.instance());
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:4,代码来源:ShouldContainAnyOf.java


示例15: AbstractOptionalAssert

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
protected AbstractOptionalAssert(Optional<VALUE> actual, Class<?> selfType) {
  super(actual, selfType);
  this.optionalValueComparisonStrategy = StandardComparisonStrategy.instance();
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:5,代码来源:AbstractOptionalAssert.java


示例16: should_fail_if_actual_contains_given_string

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
@Test
public void should_fail_if_actual_contains_given_string() {
  thrown.expectAssertionError(shouldBeSubstring("Yoda", "oda", StandardComparisonStrategy.instance()));
  strings.assertIsSubstringOf(someInfo(), "Yoda", "oda");
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:6,代码来源:Strings_assertIsSubstringOf_Test.java


示例17: should_fail_if_actual_completely_different_from_given_string

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
@Test
public void should_fail_if_actual_completely_different_from_given_string() {
  thrown.expectAssertionError(shouldBeSubstring("Yoda", "Luke", StandardComparisonStrategy.instance()));
  strings.assertIsSubstringOf(someInfo(), "Yoda", "Luke");
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:6,代码来源:Strings_assertIsSubstringOf_Test.java


示例18: should_fail_if_actual_contains_any_of_values

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
@Test
public void should_fail_if_actual_contains_any_of_values() {
  thrown.expectAssertionError(shouldNotContain("Yoda", "oda", StandardComparisonStrategy.instance()));
  strings.assertDoesNotContain(someInfo(), "Yoda", "oda");
}
 
开发者ID:joel-costigliola,项目名称:assertj-core,代码行数:6,代码来源:Strings_assertDoesNotContain_Test.java


示例19: ShouldNotHaveLabel

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
private ShouldNotHaveLabel(Node actual, String other) {
  super("\nExpecting:\n  <%s>\nnot to have label:\n  <%s>\n%s", actual, other, StandardComparisonStrategy.instance());
}
 
开发者ID:joel-costigliola,项目名称:assertj-neo4j,代码行数:4,代码来源:ShouldNotHaveLabel.java


示例20: ShouldHaveLength

import org.assertj.core.internal.StandardComparisonStrategy; //导入依赖的package包/类
private ShouldHaveLength(Path actual, int length) {
  super("\nExpecting:\n  <%s>\nto have length:\n  <%s>\n%s", actual, length, StandardComparisonStrategy.instance());
}
 
开发者ID:joel-costigliola,项目名称:assertj-neo4j,代码行数:4,代码来源:ShouldHaveLength.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FormParameter类代码示例发布时间:2022-05-22
下一篇:
Java XeLocalhost类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap