lundi 22 mai 2017

Testing List

I'm using TestNG for unit testing and now I have a method to test which return List<byte[]>. Here is how my test looks like now:

public List<byte[]> methodToTest(){
   //...
}

@Test
public void test(){
    List<byte[]> expected;
    //...
    Assert.assertEquals(methodToTest(), expected); //now fails
}

The question is if it possible to tell TestNG to perform List content comparison (byte[] in my case) with not just equals, but with Arrays.equals?

Or I will have to iterate through the List and perform comparison of every element myself?

Aucun commentaire:

Enregistrer un commentaire