org.testng.Assert.assertEqualsDeep()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中org.testng.Assert.assertEqualsDeep()方法的一些代码示例,展示了Assert.assertEqualsDeep()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.assertEqualsDeep()方法的具体详情如下:
包路径:org.testng.Assert
类名称:Assert
方法名:assertEqualsDeep

Assert.assertEqualsDeep介绍

暂无

代码示例

代码示例来源:origin: org.testng/testng

public static void assertEqualsDeep(Map<?, ?> actual, Map<?, ?> expected) {
 assertEqualsDeep(actual, expected, null);
}

代码示例来源:origin: cbeust/testng

public static void assertEqualsDeep(Map<?, ?> actual, Map<?, ?> expected) {
 assertEqualsDeep(actual, expected, null);
}

代码示例来源:origin: org.testng/testng

public static void assertNotEqualsDeep(Set<?> actual, Set<?> expected, String message) {
 boolean fail;
 try {
  Assert.assertEqualsDeep(actual, expected, message);
  fail = true;
 } catch (AssertionError e) {
  fail = false;
 }
 if (fail) {
  Assert.fail(message);
 }
}

代码示例来源:origin: org.testng/testng

public static void assertNotEqualsDeep(Map<?, ?> actual, Map<?, ?> expected, String message) {
 boolean fail;
 try {
  Assert.assertEqualsDeep(actual, expected, message);
  fail = true;
 } catch (AssertionError e) {
  fail = false;
 }
 if (fail) {
  Assert.fail(message);
 }
}

代码示例来源:origin: cbeust/testng

public static void assertNotEqualsDeep(Map<?, ?> actual, Map<?, ?> expected, String message) {
 boolean fail;
 try {
  Assert.assertEqualsDeep(actual, expected, message);
  fail = true;
 } catch (AssertionError e) {
  fail = false;
 }
 if (fail) {
  Assert.fail(message);
 }
}

代码示例来源:origin: cbeust/testng

public static void assertNotEqualsDeep(Set<?> actual, Set<?> expected, String message) {
 boolean fail;
 try {
  Assert.assertEqualsDeep(actual, expected, message);
  fail = true;
 } catch (AssertionError e) {
  fail = false;
 }
 if (fail) {
  Assert.fail(message);
 }
}

代码示例来源:origin: cbeust/testng

@Test
public void arrayInsideMapAssertEqualsDeep() {
 Map<String, int[]> map = new HashMap<>();
 map.put("array", new int[] {42});
 Map<String, int[]> mapCopy = new HashMap<>();
 mapCopy.put("array", new int[] {42});
 // arrays inside maps are compared by value in assertEqualsDeep(Map,Map)
 assertEqualsDeep(map, mapCopy);
}

代码示例来源:origin: cbeust/testng

@Test(expectedExceptions = AssertionError.class)
public void arrayDeepInSetsAssertEqualsForActualLessThanExpected() {
 Set<String> actual = new HashSet<>();
 actual.add("42");
 Set<String> expected = new HashSet<>();
 expected.add("42");
 expected.add("43");
 assertEqualsDeep(actual, expected, "Sets not equal:");
}

代码示例来源:origin: cbeust/testng

@Test
public void arrayInsideMapAssertEqualsDeepWithMessage() {
 Map<String, int[]> map = new HashMap<>();
 map.put("array", new int[] {42});
 Map<String, int[]> mapCopy = new HashMap<>();
 mapCopy.put("array", new int[] {42});
 assertEqualsDeep(
   map,
   mapCopy,
   "arrays inside maps are compared by value in assertEqualsDeep(Map,Map,String)");
}

代码示例来源:origin: cbeust/testng

@Test(expectedExceptions = AssertionError.class)
public void arrayDeepInSetsAssertEqualsForExpectedLessThanActual() {
 Set<String> actual = new HashSet<>();
 actual.add("42");
 actual.add("43");
 Set<String> expected = new HashSet<>();
 expected.add("42");
 assertEqualsDeep(actual, expected, "Sets not equal:");
}

代码示例来源:origin: cbeust/testng

@Test
public void arrayInsideSetAssertEqualsDeep() {
 Set<int[]> set = new HashSet<>();
 set.add(new int[] {42});
 Set<int[]> setCopy = new HashSet<>();
 setCopy.add(new int[] {42});
 assertEqualsDeep(set, setCopy, "arrays inside sets are compared by value in assertEqualsDeep");
}

相关文章