Coverage Summary for Class: MultimapForEachTester (com.google.common.collect.testing.google)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| MultimapForEachTester | 0% (0/1) | 0% (0/3) | 0% (0/9) |
1 /* 2 * Copyright (C) 2012 The Guava Authors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.google.common.collect.testing.google; 17 18 import static com.google.common.collect.testing.Helpers.assertEqualIgnoringOrder; 19 import static com.google.common.collect.testing.Helpers.mapEntry; 20 import static com.google.common.collect.testing.features.CollectionFeature.KNOWN_ORDER; 21 22 import com.google.common.annotations.GwtCompatible; 23 import com.google.common.collect.Multimap; 24 import com.google.common.collect.testing.features.CollectionFeature; 25 import java.util.ArrayList; 26 import java.util.List; 27 import java.util.Map.Entry; 28 import org.junit.Ignore; 29 30 /** 31 * Tests for {@link Multimap#forEach}. 32 * 33 * @author Louis Wasserman 34 */ 35 @GwtCompatible 36 @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests. 37 public class MultimapForEachTester<K, V> extends AbstractMultimapTester<K, V, Multimap<K, V>> { 38 public void testForEach() { 39 List<Entry<K, V>> entries = new ArrayList<>(); 40 multimap().forEach((k, v) -> entries.add(mapEntry(k, v))); 41 assertEqualIgnoringOrder(getSampleElements(), multimap().entries()); 42 } 43 44 @CollectionFeature.Require(KNOWN_ORDER) 45 public void testForEachOrder() { 46 List<Entry<K, V>> entries = new ArrayList<>(); 47 multimap().forEach((k, v) -> entries.add(mapEntry(k, v))); 48 assertEqualIgnoringOrder(getSampleElements(), multimap().entries()); 49 } 50 }