Subversion Repositories eFlore/Applications.del

Rev

Rev 1197 | Rev 1235 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.tela_botanica.del.test.vues.identiplante;

import static org.mockito.Mockito.mock;

import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import org.mockito.Mockito;
import org.tela_botanica.del.client.cache.CacheClient;
import org.tela_botanica.del.client.services.rest.ImageService;
import org.tela_botanica.del.client.services.rest.ObservationService;
import org.tela_botanica.del.client.vues.identiplante.resultats.ResultatsIdentiplantePresenteur;

public class ResultatIdentiplanteTest {

        private ResultatsIdentiplantePresenteur resultatPresenteur;
        private ResultatsIdentiplantePresenteur.Vue vueResultat;
        private ImageService serviceImage;

        @Before
        public void setUp() throws Exception {

                vueResultat = mock( ResultatsIdentiplantePresenteur.Vue.class, Mockito.RETURNS_MOCKS);
                serviceImage = mock(ImageService.class);
                ObservationService obsService = Mockito.mock(ObservationService.class);
                resultatPresenteur = new ResultatsIdentiplantePresenteur(obsService, vueResultat, "tout");
        }

        @Test
        public void testAfficherImages() {
                resultatPresenteur.chercherEtAfficherObservationsPageEnCours();
                assertEquals(CacheClient.getInstance().getPageCouranteRechercheImage(), 1);
        }

}