org.truth0.Truth.ASSERT-s



API Populatity

8 Client projects

Project: org.truth0

Project google/guava in file ...st.com.google.common.collect.Collections2Test.java (2012-11-29)
@@ -22,6 +22,7 @@ import static com.google.common.collect.Lists.newLinkedList;
 import static com.google.common.collect.testing.testers.CollectionIteratorTester.getIteratorKnownOrderRemoveSupportedMethod;
 import static java.util.Arrays.asList;
 import static java.util.Collections.nCopies;
+import static org.truth0.Truth.ASSERT;
 
 import com.google.common.annotations.GwtCompatible;
 import com.google.common.annotations.GwtIncompatible;
@@ -237,7 +238,7 @@ public class Collections2Test extends TestCase {
         Collections2.orderedPermutations(list);
 
     assertEquals(1, permutationSet.size());
-    assertTrue(permutationSet.contains(list));
+    ASSERT.that(permutationSet).has().item(list);
 
     Iterator<List<Integer>> permutations = permutationSet.iterator();
 
Project google/guava in file ...om.google.common.collect.AbstractMultimapTest.java (2013-05-29)
@@ -17,7 +17,6 @@
 package com.google.common.collect;
 
 import static java.util.Arrays.asList;
-import static org.truth0.Truth.ASSERT;
 
 import com.google.common.annotations.GwtCompatible;
 
@@ -128,19 +127,6 @@ public abstract class AbstractMultimapTest extends TestCase {
     assertFalse(values.contains(5));
   }
 
-  // the entries collection is more thoroughly tested in MultimapCollectionTest
-  @SuppressWarnings("unchecked") // varargs
-  public void testEntries() {
-    multimap.put("foo", 1);
-    multimap.put("foo", nullValue());
-    multimap.put(nullKey(), 3);
-    Collection<Entry<String, Integer>> entries = multimap.entries();
-    ASSERT.that(entries).has().allOf(
-        Maps.immutableEntry("foo", 1),
-        Maps.immutableEntry("foo", nullValue()),
-        Maps.immutableEntry(nullKey(), 3));
-  }
-
   public void testKeySetRemove() {
     multimap.put("foo", 1);
     multimap.put("foo", nullValue());
Project google/guava in file ...ct.testing.google.MultimapReplaceValuesTester.java (2013-05-22)
@@ -21,6 +21,7 @@ import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_
 import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_VALUES;
 import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_PUT;
 import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_REMOVE;
+import static org.truth0.Truth.ASSERT;
 
 import com.google.common.annotations.GwtCompatible;
 import com.google.common.collect.Multimap;
@@ -119,6 +120,17 @@ public class MultimapReplaceValuesTester<K, V>
       assertEquals(size + values.size() - oldKeyValues.size(), multimap().size());
     }
   }
+  
+  @MapFeature.Require({SUPPORTS_PUT, SUPPORTS_REMOVE})
+  public void testReplaceValuesPropagatesToGet() {
+    K key = sampleKeys().e0;
+    Collection<V> getCollection = multimap().get(key);
+    @SuppressWarnings("unchecked")
+    List<V> values = Arrays.asList(sampleValues().e0, sampleValues().e2, sampleValues().e3);
+    multimap().replaceValues(key, values);
+    ASSERT.that(getCollection).has().allOf(
+        sampleValues().e0, sampleValues().e2, sampleValues().e3);
+  }
 
   @MapFeature.Require(absent = SUPPORTS_REMOVE)
   @CollectionSize.Require(absent = ZERO)