Search in sources :

Example 6 with Weather

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));
}
Also used : Weather(com.octo.android.robospice.springandroid.test.model.xml.Weather)

Example 7 with Weather

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;
}
Also used : Weather(com.octo.android.robospice.springandroid.test.model.xml.Weather) ArrayList(java.util.ArrayList) Curren_weather(com.octo.android.robospice.springandroid.test.model.xml.Curren_weather)

Example 8 with 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));
}
Also used : Weather(com.octo.android.robospice.springandroid.test.model.xml.Weather)

Aggregations

Weather (com.octo.android.robospice.springandroid.test.model.xml.Weather)8 Curren_weather (com.octo.android.robospice.springandroid.test.model.xml.Curren_weather)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1