string comparison + linkedList

1

Good evening, I'm trying to compare a string with a linked list but I'm not having success, the linked list is being returned a value from another function, but I'll put the linked list output here.

assertEquals("nome composto",frase.converterCamelCase("nomeComposto"));

The test blames what happened.

java.lang.AssertionError: expected: < compound name > but was: < [name, compound] >

How can I get this test through?

    
asked by anonymous 08.07.2016 / 02:00

1 answer

1

What you really want to test is the output of this method converterCamelCase , so I would do the following, I would test that for every item present in LinkedList returned from this method it agrees with the string passed as parameter, in code would look something like this:

assertEquals("nome",frase.converterCamelCase("nomeComposto").get(0));
assertEquals("composto",frase.converterCamelCase("nomeComposto").get(1));
    
08.07.2016 / 02:37