code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
@Test
public void testContainsAnyIn_fails() {
AssertionError unused =
expectFailure(
whenTesting -> whenTesting.that(LongStream.of(42)).containsAnyIn(asList(43, 44)));
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsAnyIn_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testDoesNotContain() {
assertThat(LongStream.of(42)).doesNotContain(43);
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testDoesNotContain | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testDoesNotContain_fails() {
AssertionError unused =
expectFailure(whenTesting -> whenTesting.that(LongStream.of(42)).doesNotContain(42));
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testDoesNotContain_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsNoneOf() {
assertThat(LongStream.of(42)).containsNoneOf(43, 44);
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsNoneOf | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsNoneOf_fails() {
AssertionError unused =
expectFailure(whenTesting -> whenTesting.that(LongStream.of(42)).containsNoneOf(42, 43));
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsNoneOf_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsNoneIn() {
assertThat(LongStream.of(42)).containsNoneIn(asList(43, 44));
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsNoneIn | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsNoneIn_fails() {
AssertionError unused =
expectFailure(
whenTesting -> whenTesting.that(LongStream.of(42)).containsNoneIn(asList(42L, 43L)));
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsNoneIn_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsAtLeast() {
assertThat(LongStream.of(42, 43)).containsAtLeast(42, 43);
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsAtLeast | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsAtLeast_fails() {
AssertionError unused =
expectFailure(
whenTesting -> whenTesting.that(LongStream.of(42, 43)).containsAtLeast(42, 43, 44));
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsAtLeast_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsAtLeast_inOrder() {
assertThat(LongStream.of(42, 43)).containsAtLeast(42, 43).inOrder();
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsAtLeast_inOrder | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsAtLeast_inOrder_fails() {
AssertionError expected =
expectFailure(
whenTesting ->
whenTesting.that(LongStream.of(42, 43)).containsAtLeast(43, 42).inOrder());
assertFailureKeys(
expected,
"required elements were all found, but or... | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsAtLeast_inOrder_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsAtLeastElementsIn() {
assertThat(LongStream.of(42, 43)).containsAtLeastElementsIn(asList(42L, 43L));
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsAtLeastElementsIn | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsAtLeastElementsIn_fails() {
AssertionError unused =
expectFailure(
whenTesting ->
whenTesting
.that(LongStream.of(42, 43))
.containsAtLeastElementsIn(asList(42L, 43L, 44L)));
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsAtLeastElementsIn_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsAtLeastElementsIn_wrongType_fails() {
AssertionError unused =
expectFailure(
whenTesting ->
whenTesting
.that(LongStream.of(42, 43))
.containsAtLeastElementsIn(asList(42, 43, 44)));
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsAtLeastElementsIn_wrongType_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsAtLeastElementsIn_inOrder() {
assertThat(LongStream.of(42, 43)).containsAtLeastElementsIn(asList(42L, 43L)).inOrder();
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsAtLeastElementsIn_inOrder | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsAtLeastElementsIn_inOrder_fails() {
AssertionError expected =
expectFailure(
whenTesting ->
whenTesting
.that(LongStream.of(42, 43))
.containsAtLeastElementsIn(asList(43L, 42L))
.inOrder()... | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsAtLeastElementsIn_inOrder_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsAtLeastElementsIn_inOrder_wrongType_fails() {
AssertionError unused =
expectFailure(
whenTesting ->
whenTesting
.that(LongStream.of(42, 43))
.containsAtLeastElementsIn(asList(43, 42))
.inO... | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsAtLeastElementsIn_inOrder_wrongType_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsExactly() {
assertThat(LongStream.of(42, 43)).containsExactly(42, 43);
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsExactly | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsExactly_fails() {
AssertionError expected =
expectFailure(whenTesting -> whenTesting.that(LongStream.of(42, 43)).containsExactly(42));
assertFailureKeys(expected, "unexpected (1)", "---", "expected", "but was");
assertFailureValue(expected, "expected", "[42]");
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsExactly_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsExactly_inOrder() {
assertThat(LongStream.of(42, 43)).containsExactly(42, 43).inOrder();
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsExactly_inOrder | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsExactly_inOrder_fails() {
AssertionError expected =
expectFailure(
whenTesting ->
whenTesting.that(LongStream.of(42, 43)).containsExactly(43, 42).inOrder());
assertFailureKeys(expected, "contents match, but order was wrong", "expected", "but wa... | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsExactly_inOrder_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsExactlyElementsIn() {
assertThat(LongStream.of(42, 43)).containsExactlyElementsIn(asList(42L, 43L));
assertThat(LongStream.of(42, 43)).containsExactlyElementsIn(asList(43L, 42L));
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsExactlyElementsIn | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsExactlyElementsIn_fails() {
AssertionError expected =
expectFailure(
whenTesting ->
whenTesting.that(LongStream.of(42, 43)).containsExactlyElementsIn(asList(42L)));
assertFailureKeys(expected, "unexpected (1)", "---", "expected", "but was");
... | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsExactlyElementsIn_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsExactlyElementsIn_wrongType_fails() {
AssertionError unused =
expectFailure(
whenTesting ->
whenTesting.that(LongStream.of(42, 43)).containsExactlyElementsIn(asList(42)));
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsExactlyElementsIn_wrongType_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsExactlyElementsIn_inOrder() {
assertThat(LongStream.of(42, 43)).containsExactlyElementsIn(asList(42L, 43L)).inOrder();
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsExactlyElementsIn_inOrder | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsExactlyElementsIn_inOrder_fails() {
AssertionError expected =
expectFailure(
whenTesting ->
whenTesting
.that(LongStream.of(42, 43))
.containsExactlyElementsIn(asList(43L, 42L))
.inOrder()... | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsExactlyElementsIn_inOrder_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsExactlyElementsIn_inOrder_wrongType_fails() {
AssertionError unused =
expectFailure(
whenTesting ->
whenTesting
.that(LongStream.of(42, 43))
.containsExactlyElementsIn(asList(43, 42))
.inO... | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsExactlyElementsIn_inOrder_wrongType_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testContainsExactlyElementsIn_inOrder_LongStream() {
assertThat(LongStream.of(1, 2, 3, 4)).containsExactly(1, 2, 3, 4).inOrder();
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testContainsExactlyElementsIn_inOrder_LongStream | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testIsInOrder() {
assertThat(LongStream.of()).isInOrder();
assertThat(LongStream.of(1)).isInOrder();
assertThat(LongStream.of(1, 1, 2, 3, 3, 3, 4)).isInOrder();
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testIsInOrder | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testIsInOrder_fails() {
AssertionError unused =
expectFailure(whenTesting -> whenTesting.that(LongStream.of(1, 3, 2, 4)).isInOrder());
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testIsInOrder_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testIsInStrictOrder() {
assertThat(LongStream.of()).isInStrictOrder();
assertThat(LongStream.of(1)).isInStrictOrder();
assertThat(LongStream.of(1, 2, 3, 4)).isInStrictOrder();
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testIsInStrictOrder | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
public void testIsInStrictOrder_fails() {
AssertionError unused =
expectFailure(whenTesting -> whenTesting.that(LongStream.of(1, 2, 2, 4)).isInStrictOrder());
} | Tests for {@link LongStream} Subjects.
@author Kurt Alfred Kluever | testIsInStrictOrder_fails | java | google/truth | core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongStreamSubjectTest.java | Apache-2.0 |
@Test
@SuppressWarnings("TruthSelfEquals")
public void simpleEquality() {
assertThat(4L).isEqualTo(4L);
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | simpleEquality | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void simpleInequality() {
assertThat(4L).isNotEqualTo(5L);
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | simpleInequality | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void equalityWithInts() {
assertThat(0L).isEqualTo(0);
expectFailure(whenTesting -> whenTesting.that(0L).isNotEqualTo(0));
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | equalityWithInts | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void equalityFail() {
expectFailure(whenTesting -> whenTesting.that(4L).isEqualTo(5L));
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | equalityFail | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@SuppressWarnings("SelfAssertion")
@Test
public void inequalityFail() {
expectFailure(whenTesting -> whenTesting.that(4L).isNotEqualTo(4L));
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | inequalityFail | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void equalityOfNulls() {
assertThat((Long) null).isEqualTo(null);
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | equalityOfNulls | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void equalityOfNullsFail_nullActual() {
expectFailure(whenTesting -> whenTesting.that((Long) null).isEqualTo(5L));
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | equalityOfNullsFail_nullActual | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void equalityOfNullsFail_nullExpected() {
expectFailure(whenTesting -> whenTesting.that(5L).isEqualTo(null));
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | equalityOfNullsFail_nullExpected | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void inequalityOfNulls() {
assertThat(4L).isNotEqualTo(null);
assertThat((Integer) null).isNotEqualTo(4L);
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | inequalityOfNulls | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void inequalityOfNullsFail() {
expectFailure(whenTesting -> whenTesting.that((Long) null).isNotEqualTo(null));
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | inequalityOfNullsFail | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@SuppressWarnings("SelfAssertion")
@Test
public void testNumericTypeWithSameValue_shouldBeEqual_long_long() {
expectFailure(whenTesting -> whenTesting.that(42L).isNotEqualTo(42L));
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | testNumericTypeWithSameValue_shouldBeEqual_long_long | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void testNumericTypeWithSameValue_shouldBeEqual_long_int() {
expectFailure(whenTesting -> whenTesting.that(42L).isNotEqualTo(42));
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | testNumericTypeWithSameValue_shouldBeEqual_long_int | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void isGreaterThan_int_strictly() {
expectFailure(whenTesting -> whenTesting.that(2L).isGreaterThan(3));
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | isGreaterThan_int_strictly | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void isGreaterThan_int() {
expectFailure(whenTesting -> whenTesting.that(2L).isGreaterThan(2));
assertThat(2L).isGreaterThan(1);
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | isGreaterThan_int | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void isLessThan_int_strictly() {
expectFailure(whenTesting -> whenTesting.that(2L).isLessThan(1));
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | isLessThan_int_strictly | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void isLessThan_int() {
expectFailure(whenTesting -> whenTesting.that(2L).isLessThan(2));
assertThat(2L).isLessThan(3);
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | isLessThan_int | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void isAtLeast_int() {
expectFailure(whenTesting -> whenTesting.that(2L).isAtLeast(3));
assertThat(2L).isAtLeast(2);
assertThat(2L).isAtLeast(1);
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | isAtLeast_int | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void isAtMost_int() {
expectFailure(whenTesting -> whenTesting.that(2L).isAtMost(1));
assertThat(2L).isAtMost(2);
assertThat(2L).isAtMost(3);
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | isAtMost_int | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void isWithinOf() {
assertThat(20000L).isWithin(0L).of(20000L);
assertThat(20000L).isWithin(1L).of(20000L);
assertThat(20000L).isWithin(10000L).of(20000L);
assertThat(20000L).isWithin(10000L).of(30000L);
assertThat(Long.MIN_VALUE).isWithin(1L).of(Long.MIN_VALUE + 1);
assertThat(Lo... | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | isWithinOf | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
private static void assertThatIsWithinFails(long actual, long tolerance, long expected) {
AssertionError failure =
expectFailure(whenTesting -> whenTesting.that(actual).isWithin(tolerance).of(expected));
assertThat(failure)
.factKeys()
.containsExactly("expected", "but was", "outside tol... | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | assertThatIsWithinFails | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void isNotWithinOf() {
assertThatIsNotWithinFails(20000L, 0L, 20000L);
assertThatIsNotWithinFails(20000L, 1L, 20000L);
assertThatIsNotWithinFails(20000L, 10000L, 20000L);
assertThatIsNotWithinFails(20000L, 10000L, 30000L);
assertThatIsNotWithinFails(Long.MIN_VALUE, 1L, Long.MIN_VALUE ... | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | isNotWithinOf | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
private static void assertThatIsNotWithinFails(long actual, long tolerance, long expected) {
AssertionError failure =
expectFailure(whenTesting -> whenTesting.that(actual).isNotWithin(tolerance).of(expected));
assertThat(failure).factValue("expected not to be").isEqualTo(formatNumericValue(expected));
... | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | assertThatIsNotWithinFails | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void isWithinIntegers() {
assertThat(20000L).isWithin(0).of(20000);
assertThat(20000L).isWithin(1).of(20000);
assertThat(20000L).isWithin(10000).of(20000);
assertThat(20000L).isWithin(10000).of(30000);
assertThat(20000L).isNotWithin(0).of(200000);
assertThat(20000L).isNotWithin(1... | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | isWithinIntegers | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void isWithinNegativeTolerance() {
isWithinNegativeToleranceThrows(0L, -10, 0L);
isWithinNegativeToleranceThrows(0L, -10, 0L);
isNotWithinNegativeToleranceThrows(0L, -10, 0L);
isNotWithinNegativeToleranceThrows(0L, -10, 0L);
} | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | isWithinNegativeTolerance | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
private static void isWithinNegativeToleranceThrows(long actual, long tolerance, long expected) {
AssertionError e =
expectFailure(whenTesting -> whenTesting.that(actual).isWithin(tolerance).of(expected));
assertFailureKeys(
e,
"could not perform approximate-equality check because tolera... | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | isWithinNegativeToleranceThrows | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
private static void isNotWithinNegativeToleranceThrows(
long actual, long tolerance, long expected) {
AssertionError e =
expectFailure(whenTesting -> whenTesting.that(actual).isNotWithin(tolerance).of(expected));
assertFailureKeys(
e,
"could not perform approximate-equality check b... | Tests for Long Subjects.
@author David Saff
@author Christian Gruber
@author Kurt Alfred Kluever | isNotWithinNegativeToleranceThrows | java | google/truth | core/src/test/java/com/google/common/truth/LongSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/LongSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyWithNullKey() {
Map<String, String> actual = new HashMap<>();
actual.put(null, "value");
assertThat(actual).containsExactly(null, "value");
assertThat(actual).containsExactly(null, "value").inOrder();
assertThat(actual).containsExactlyEntriesIn(actual);
assert... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyWithNullKey | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyWithNullValue() {
Map<String, String> actual = new HashMap<>();
actual.put("key", null);
assertThat(actual).containsExactly("key", null);
assertThat(actual).containsExactly("key", null).inOrder();
assertThat(actual).containsExactlyEntriesIn(actual);
assertThat... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyWithNullValue | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyEmpty() {
ImmutableMap<String, Integer> actual = ImmutableMap.of();
assertThat(actual).containsExactly();
assertThat(actual).containsExactly().inOrder();
assertThat(actual).containsExactlyEntriesIn(actual);
assertThat(actual).containsExactlyEntriesIn(actual).inOrd... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyEmpty | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyEmpty_fails() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1);
AssertionError e = expectFailure(whenTesting -> whenTesting.that(actual).containsExactly());
assertFailureKeys(e, "expected to be empty", "but was");
} | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyEmpty_fails | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyEntriesInEmpty_fails() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1);
AssertionError e =
expectFailure(
whenTesting -> whenTesting.that(actual).containsExactlyEntriesIn(ImmutableMap.of()));
assertFailureKeys(e, "expected to be empt... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyEntriesInEmpty_fails | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyOneEntry() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1);
assertThat(actual).containsExactly("jan", 1);
assertThat(actual).containsExactly("jan", 1).inOrder();
assertThat(actual).containsExactlyEntriesIn(actual);
assertThat(actual).containsExa... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyOneEntry | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyMultipleEntries() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
assertThat(actual).containsExactly("march", 3, "jan", 1, "feb", 2);
assertThat(actual).containsExactly("jan", 1, "feb", 2, "march", 3).inOrder();
assertThat(act... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyMultipleEntries | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyDuplicateKeys() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
IllegalArgumentException expected =
assertThrows(
IllegalArgumentException.class,
() -> assertThat(actual).containsExactly("jan", 1, "jan"... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyDuplicateKeys | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyMultipleDuplicateKeys() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
IllegalArgumentException expected =
assertThrows(
IllegalArgumentException.class,
() -> assertThat(actual).containsExactly("jan", ... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyMultipleDuplicateKeys | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyExtraKey() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
AssertionError e =
expectFailure(whenTesting -> whenTesting.that(actual).containsExactly("feb", 2, "jan", 1));
assertFailureKeys(
e, "unexpected keys", "for... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyExtraKey | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyExtraKeyInOrder() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
AssertionError e =
expectFailure(
whenTesting -> whenTesting.that(actual).containsExactly("feb", 2, "jan", 1).inOrder());
assertFailureKeys(
... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyExtraKeyInOrder | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyMissingKey() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2);
AssertionError e =
expectFailure(
whenTesting ->
whenTesting.that(actual).containsExactly("jan", 1, "march", 3, "feb", 2));
assertFailureKeys(e, "... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyMissingKey | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyWrongValue() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
AssertionError e =
expectFailure(
whenTesting ->
whenTesting.that(actual).containsExactly("jan", 1, "march", 33, "feb", 2));
assertFai... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyWrongValue | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyWrongValueWithNull() {
// Test for https://github.com/google/truth/issues/468
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
AssertionError e =
expectFailure(
whenTesting ->
whenTesting.that(actua... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyWrongValueWithNull | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyExtraKeyAndMissingKey() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "march", 3);
AssertionError e =
expectFailure(whenTesting -> whenTesting.that(actual).containsExactly("jan", 1, "feb", 2));
assertFailureKeys(
e,
"missing key... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyExtraKeyAndMissingKey | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyExtraKeyAndWrongValue() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
AssertionError e =
expectFailure(
whenTesting -> whenTesting.that(actual).containsExactly("jan", 1, "march", 33));
assertFailureKeys(
... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyExtraKeyAndWrongValue | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyMissingKeyAndWrongValue() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "march", 3);
AssertionError e =
expectFailure(
whenTesting ->
whenTesting.that(actual).containsExactly("jan", 1, "march", 33, "feb", 2));
assert... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyMissingKeyAndWrongValue | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyExtraKeyAndMissingKeyAndWrongValue() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "march", 3);
AssertionError e =
expectFailure(
whenTesting -> whenTesting.that(actual).containsExactly("march", 33, "feb", 2));
assertFailureKeys(
... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyExtraKeyAndMissingKeyAndWrongValue | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyNotInOrder() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
assertThat(actual).containsExactlyEntriesIn(actual);
assertThat(actual).containsExactlyEntriesIn(actual).inOrder();
assertThat(actual).containsExactly("jan", 1, "mar... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyNotInOrder | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
@SuppressWarnings("ShouldHaveEvenArgs")
public void containsExactlyBadNumberOfArgs() {
ImmutableMap<String, Integer> actual =
ImmutableMap.of("jan", 1, "feb", 2, "march", 3, "april", 4, "may", 5);
assertThat(actual).containsExactlyEntriesIn(actual);
assertThat(actual).containsExactlyEntrie... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyBadNumberOfArgs | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyWrongValue_sameToStringForValues() {
AssertionError e =
expectFailure(
whenTesting ->
whenTesting
.that(ImmutableMap.of("jan", 1L, "feb", 2L))
.containsExactly("jan", 1, "feb", 2));
assertFailureKeys(
... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyWrongValue_sameToStringForValues | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyWrongValue_sameToStringForKeys() {
AssertionError e =
expectFailure(
whenTesting ->
whenTesting
.that(ImmutableMap.of(1L, "jan", 1, "feb"))
.containsExactly(1, "jan", 1L, "feb"));
assertFailureKeys(
... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyWrongValue_sameToStringForKeys | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsExactlyExtraKeyAndMissingKey_failsWithSameToStringForKeys() {
AssertionError e =
expectFailure(
whenTesting ->
whenTesting
.that(ImmutableMap.of(1L, "jan", 2, "feb"))
.containsExactly(1, "jan", 2, "feb"));
as... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsExactlyExtraKeyAndMissingKey_failsWithSameToStringForKeys | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastWithNullKey() {
Map<String, String> actual = new HashMap<>();
actual.put(null, "value");
actual.put("unexpectedKey", "unexpectedValue");
Map<String, String> expected = new HashMap<>();
expected.put(null, "value");
assertThat(actual).containsAtLeast(null, "valu... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastWithNullKey | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastWithNullValue() {
Map<String, String> actual = new HashMap<>();
actual.put("key", null);
actual.put("unexpectedKey", "unexpectedValue");
Map<String, String> expected = new HashMap<>();
expected.put("key", null);
assertThat(actual).containsAtLeast("key", null);... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastWithNullValue | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastEmpty() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("key", 1);
assertThat(actual).containsAtLeastEntriesIn(ImmutableMap.of());
assertThat(actual).containsAtLeastEntriesIn(ImmutableMap.of()).inOrder();
} | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastEmpty | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastOneEntry() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1);
assertThat(actual).containsAtLeast("jan", 1);
assertThat(actual).containsAtLeast("jan", 1).inOrder();
assertThat(actual).containsAtLeastEntriesIn(actual);
assertThat(actual).containsAtL... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastOneEntry | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastMultipleEntries() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "mar", 3, "apr", 4);
assertThat(actual).containsAtLeast("apr", 4, "jan", 1, "feb", 2);
assertThat(actual).containsAtLeast("jan", 1, "feb", 2, "apr", 4).inOrder();
assertThat... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastMultipleEntries | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastDuplicateKeys() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
IllegalArgumentException expected =
assertThrows(
IllegalArgumentException.class,
() -> assertThat(actual).containsAtLeast("jan", 1, "jan"... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastDuplicateKeys | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastMultipleDuplicateKeys() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
IllegalArgumentException expected =
assertThrows(
IllegalArgumentException.class,
() -> assertThat(actual).containsAtLeast("jan", ... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastMultipleDuplicateKeys | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastMissingKey() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2);
AssertionError e =
expectFailure(
whenTesting -> whenTesting.that(actual).containsAtLeast("jan", 1, "march", 3));
assertFailureKeys(
e,
"missing k... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastMissingKey | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastWrongValue() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
AssertionError e =
expectFailure(
whenTesting -> whenTesting.that(actual).containsAtLeast("jan", 1, "march", 33));
assertFailureKeys(
e,
... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastWrongValue | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastWrongValueWithNull() {
// Test for https://github.com/google/truth/issues/468
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
AssertionError e =
expectFailure(
whenTesting -> whenTesting.that(actual).containsAtLea... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastWrongValueWithNull | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastExtraKeyAndMissingKeyAndWrongValue() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "march", 3);
AssertionError e =
expectFailure(
whenTesting -> whenTesting.that(actual).containsAtLeast("march", 33, "feb", 2));
assertFailureKeys(
... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastExtraKeyAndMissingKeyAndWrongValue | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastNotInOrder() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
assertThat(actual).containsAtLeast("march", 3, "feb", 2);
AssertionError e =
expectFailure(
whenTesting ->
whenTesting.that(actual).c... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastNotInOrder | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
@SuppressWarnings("ShouldHaveEvenArgs")
public void containsAtLeastBadNumberOfArgs() {
ImmutableMap<String, Integer> actual =
ImmutableMap.of("jan", 1, "feb", 2, "march", 3, "april", 4, "may", 5);
IllegalArgumentException expected =
assertThrows(
IllegalArgumentException.c... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastBadNumberOfArgs | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastWrongValue_sameToStringForValues() {
AssertionError e =
expectFailure(
whenTesting ->
whenTesting
.that(ImmutableMap.of("jan", 1L, "feb", 2L, "mar", 3L))
.containsAtLeast("jan", 1, "feb", 2));
assertFa... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastWrongValue_sameToStringForValues | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastWrongValue_sameToStringForKeys() {
AssertionError e =
expectFailure(
whenTesting ->
whenTesting
.that(ImmutableMap.of(1L, "jan", 1, "feb"))
.containsAtLeast(1, "jan", 1L, "feb"));
assertFailureKeys(
... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastWrongValue_sameToStringForKeys | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void containsAtLeastExtraKeyAndMissingKey_failsWithSameToStringForKeys() {
AssertionError e =
expectFailure(
whenTesting ->
whenTesting
.that(ImmutableMap.of(1L, "jan", 2, "feb"))
.containsAtLeast(1, "jan", 2, "feb"));
as... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | containsAtLeastExtraKeyAndMissingKey_failsWithSameToStringForKeys | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void isEqualToPass() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
ImmutableMap<String, Integer> expectedMap = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
assertThat(actual).isEqualTo(expectedMap);
} | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | isEqualToPass | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void isEqualToFailureExtraMissingAndDiffering() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
ImmutableMap<String, Integer> expectedMap = ImmutableMap.of("jan", 1, "april", 4, "march", 5);
AssertionError e =
expectFailure(whenTesting -> whe... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | isEqualToFailureExtraMissingAndDiffering | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
@Test
public void isEqualToFailureDiffering() {
ImmutableMap<String, Integer> actual = ImmutableMap.of("jan", 1, "feb", 2, "march", 3);
ImmutableMap<String, Integer> expectedMap = ImmutableMap.of("jan", 1, "feb", 2, "march", 4);
AssertionError e =
expectFailure(whenTesting -> whenTesting.that(act... | Tests for {@link Map} subjects.
@author Christian Gruber
@author Kurt Alfred Kluever | isEqualToFailureDiffering | java | google/truth | core/src/test/java/com/google/common/truth/MapSubjectTest.java | https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/MapSubjectTest.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.