“Erro: o método assertThat (t, Matcher” Respostas de código

Erro: o método assertThat (t, Matcher ) no tipo MatcheSert não é aplicável aos argumentos (List , Matcher >)

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.equalTo;

boolean a;
boolean b;

// all statements test the same
assertThat(a, equalTo(b));
assertThat(a, is(equalTo(b)));
assertThat(a, is(b));
Hilarious Hare

Erro: o método assertThat (t, Matcher ) no tipo MatcheSert não é aplicável aos argumentos (List , Matcher >)

assertThat("test", anyOf(is("testing"), containsString("est")));
Hilarious Hare

Erro: o método assertThat (t, Matcher ) no tipo MatcheSert não é aplicável aos argumentos (List , Matcher >)

// JUnit 4 for equals check
assertEquals(expected, actual);
// Hamcrest for equals check
assertThat(actual, is(equalTo(expected)));

// JUnit 4 for not equals check
assertNotEquals(expected, actual)
// Hamcrest for not equals check
assertThat(actual, is(not(equalTo(expected))));
Hilarious Hare

Respostas semelhantes a “Erro: o método assertThat (t, Matcher”

Perguntas semelhantes a “Erro: o método assertThat (t, Matcher”

Procure respostas de código populares por idioma

Procurar outros idiomas de código