it.tidalwave.bluebill.mobile.android.test.functional.ChangeObservationDateTest Maven / Gradle / Ivy
/***********************************************************************************************************************
*
* blueBill Mobile - open source birdwatching
* ==========================================
*
* Copyright (C) 2009, 2010 by Tidalwave s.a.s. (http://www.tidalwave.it)
* http://bluebill.tidalwave.it/mobile/
*
***********************************************************************************************************************
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
***********************************************************************************************************************
*
* $Id: ChangeObservationDateTest.java,v bcf37bbdff9d 2010/08/17 18:04:46 fabrizio $
*
**********************************************************************************************************************/
package it.tidalwave.bluebill.mobile.android.test.functional;
import java.util.Calendar;
import static java.util.Calendar.*;
import static it.tidalwave.bluebill.mobile.android.taxonomy.browser.TaxonomyPicker.*;
import static it.tidalwave.bluebill.mobile.android.taxonomy.browser.TaxonPicker.*;
import static it.tidalwave.bluebill.mobile.android.observation.CountAndGenderPickerFactory.*;
import static it.tidalwave.bluebill.mobile.android.location.LocationPickerFactory.*;
/***********************************************************************************************************************
*
* @author Fabrizio Giudici
* @version $Id: $
*
**********************************************************************************************************************/
public class ChangeObservationDateTest extends ObservationScenarioTestSupport
{
protected void prepareSequence()
{
final Calendar july_20_2010 = Calendar.getInstance();
july_20_2010.set(YEAR, 2010);
july_20_2010.set(MONTH, JULY);
july_20_2010.set(DAY_OF_MONTH, 20);
step(ClearAllObservations.class);
step(TaxonomyChangerFromObservationsActivity.class, pickEbnItalia2003());
step(InsertObservation.class, pickTheLittleGrebe(),
dontSpecifyCountAndGender(),
confirmImmediatelyTheLocation());
step(InsertObservation.class, pickTheEurasianSpoonBill(),
dontSpecifyCountAndGender(),
confirmImmediatelyTheLocation());
step(ChangeObservationDate.class, 1,
july_20_2010);
}
protected void assertPostConditions()
{
observationActivity.assertHeaderText("2 observations");
observationActivity.assertObservationCount(2);
observationActivity.assertObservationItemCount(0, 1);
observationActivity.assertObservationItemCount(1, 1);
observationActivity.assertThatLastNodeIsExpandedOthersAreCollapsed();
// TODO: assert date changed
// TODO: assert screen contents, also properly sorted
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy