Back to project page umbrella.alert.
The source code is released under:
GNU General Public License
If you think the Android project umbrella.alert listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package macbury.umbrella; //from w w w .j ava 2 s .com import android.test.ApplicationTestCase; import junit.framework.TestCase; import macbury.umbrella.factories.WeatherForecastFactory; import macbury.umbrella.model.Forecast; /** * Created by macbury on 27.08.14. */ public class ForecastTest extends TestCase { public void testItShouldHaveParsedRainDataWithDate() { Forecast forecast = new Forecast(); forecast.parse(WeatherForecastFactory.rainNext6Hours()); assertNotNull(forecast.getFromDate()); assertNotNull(forecast.getToDate()); assertNotNull(forecast.getCity()); assertNotSame(forecast.getFromDate(), forecast.getToDate()); assertEquals(true, forecast.getFromDate().before(forecast.getToDate())); } public void testItShouldTakeUmbrellaIfThereIsAnyChanceOfRainInNext6Hrs() { Forecast forecast = new Forecast(); forecast.parse(WeatherForecastFactory.rainNext6Hours()); assertTrue(forecast.takeUmbrella()); } public void testItShouldNotTakeUmbrellaIfThereIsNoChanceOfRainInNext6Hrs() { Forecast forecast = new Forecast(); forecast.parse(WeatherForecastFactory.notRainNext6Hours()); assertEquals(0, forecast.getTotalRainVolume()); assertFalse(forecast.takeUmbrella()); } }