use of com.octo.android.robospice.springandroid.test.model.xml.Weather in project robospice by stephanenicolas.
the class InFileWeatherPersisterTest method test_saveDataAndReturnData.
public void test_saveDataAndReturnData() throws Exception {
// GIVEN
Weather weatherRequestStatus = buildWeather(TEST_TEMP);
// WHEN
Weather weatherReturned = dataPersistenceManager.saveDataToCacheAndReturnData(weatherRequestStatus, "weather.xml");
// THEN
assertTrue(weatherReturned.getListWeather().contains(TEST_TEMP));
}
use of com.octo.android.robospice.springandroid.test.model.xml.Weather in project robospice by stephanenicolas.
the class InFileWeatherPersisterTest method buildWeather.
private Weather buildWeather(Curren_weather curren_weather) {
Weather weather = new Weather();
List<Curren_weather> currents = new ArrayList<Curren_weather>();
currents.add(curren_weather);
weather.setListWeather(currents);
weather.setListForecast(null);
return weather;
}
use of com.octo.android.robospice.springandroid.test.model.xml.Weather in project robospice by stephanenicolas.
the class InFileWeatherPersisterTest method test_loadAllDataFromCache_with_one_request_in_cache.
public void test_loadAllDataFromCache_with_one_request_in_cache() throws Exception {
// GIVEN
Weather weatherRequestStatus = buildWeather(TEST_TEMP);
dataPersistenceManager.saveDataToCacheAndReturnData(weatherRequestStatus, FILE_NAME);
// WHEN
List<Weather> listWeatherResult = dataPersistenceManager.loadAllDataFromCache();
// THEN
assertNotNull(listWeatherResult);
assertEquals(1, listWeatherResult.size());
assertEquals(weatherRequestStatus, listWeatherResult.get(0));
}
Aggregations