Code example for List

Methods: contains, size

0
        // WHEN 
        List<WeatherResult> listWeatherResult = inFileObjectPersister.loadAllDataFromCache();
 
        // THEN 
        assertNotNull(listWeatherResult);
        assertEquals(2, listWeatherResult.size());
        assertTrue(listWeatherResult.contains(weatherRequestStatus));
        assertTrue(listWeatherResult.contains(weatherRequestStatus2));
    } 
 
    public void test_loadAllDataFromCache_with_no_requests_in_cache() throws Exception { 
        // GIVEN 
 
        // WHEN 
        List<WeatherResult> listWeatherResult = inFileObjectPersister.loadAllDataFromCache();
 
        // THEN 
        assertNotNull(listWeatherResult);
        assertTrue(listWeatherResult.isEmpty());
    }