When using
assertEquals(long actual, long expected) and assertNotEquals(**,**) in org.testng.Assert, pay attention to comparing the data types at both ends.
provided in the Assert class - assertEquals supports: boolean double float int long Map Object byte[] byte char Coolection, etc. See API
for details assertNotEquals only supports three types: float double Object.
If an unsupported data type is used, Object will be called!
# For example:
long long1 = 10L; long long2 = 10L; // 以下 代码 全部通过,不会产生 assert 退出; Assert.assertEquals(long1, long2); //Assert.assertEqualslong,long) Assert.assertEquals(long1, 10); //Assert.assertEquals(long,long) Assert.assertNotEquals(long1, 10);//Assert.assertNotEquals(Object,Object) Assert.assertNotEquals(long2, 10); //Assert.assertNotEquals(Object,Object) Assert.assertNotEquals(long2, 9);//Assert.assertNotEquals(Object,Object)
and above are Assertequals and Assertnotequals. Use the content of assertnotequals carefully. For more related content, please pay attention to PHP Chinese (www.php.cn)!