All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.tidalwave.bluebill.mobile.android.test.functional.ChangeObservationDateTest Maven / Gradle / Ivy

The newest version!
/***********************************************************************************************************************
 *
 * blueBill Mobile - Android - open source birding
 * Copyright (C) 2009-2011 by Tidalwave s.a.s. (http://www.tidalwave.it)
 *
 ***********************************************************************************************************************
 *
 * 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.
 *
 ***********************************************************************************************************************
 *
 * WWW: http://bluebill.tidalwave.it/mobile
 * SCM: https://java.net/hg/bluebill-mobile~android-src
 *
 **********************************************************************************************************************/
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 - 2024 Weber Informatics LLC | Privacy Policy