Subversion Repositories eFlore/Applications.del

Rev

Rev 1197 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1197 Rev 1201
1
package org.tela_botanica.del.test.vues.rechercheimages;
1
package org.tela_botanica.del.test.vues.identiplante;
2
 
2
 
3
import static org.mockito.Mockito.mock;
3
import static org.mockito.Mockito.mock;
4
 
4
 
5
import org.junit.Before;
5
import org.junit.Before;
6
import org.junit.Test;
6
import org.junit.Test;
7
import static org.junit.Assert.*;
7
import static org.junit.Assert.*;
8
import org.mockito.Mockito;
8
import org.mockito.Mockito;
9
import org.tela_botanica.del.client.cache.CacheClient;
9
import org.tela_botanica.del.client.cache.CacheClient;
10
import org.tela_botanica.del.client.services.rest.ImageService;
10
import org.tela_botanica.del.client.services.rest.ImageService;
11
import org.tela_botanica.del.client.services.rest.ProtocoleService;
11
import org.tela_botanica.del.client.services.rest.ObservationService;
12
import org.tela_botanica.del.client.vues.rechercheimages.resultats.ResultatRechercheImagePresenteur;
12
import org.tela_botanica.del.client.vues.identiplante.resultats.ResultatsIdentiplantePresenteur;
13
 
13
 
14
public class ResultatRechercheImagePresenteurTest {
14
public class ResultatIdentiplanteTest {
15
 
15
 
16
	private ResultatPictofloraPresenteur resultatPresenteur;
16
	private ResultatsIdentiplantePresenteur resultatPresenteur;
17
	private org.tela_botanica.del.client.vues.rechercheimages.resultats.ResultatRechercheImagePresenteur.ResultatPictofloraPresenteur vueResultat;
17
	private ResultatsIdentiplantePresenteur.Vue vueResultat;
18
	private ImageService serviceImage;
18
	private ImageService serviceImage;
19
 
19
 
20
	@Before
20
	@Before
21
	public void setUp() throws Exception {
21
	public void setUp() throws Exception {
22
 
22
 
23
		vueResultat = mock(org.tela_botanica.del.client.vues.ResultatPictofloraPresenteur.resultats.ResultatRechercheImagePresenteur.Vue.class, Mockito.RETURNS_MOCKS);
23
		vueResultat = mock( ResultatsIdentiplantePresenteur.Vue.class, Mockito.RETURNS_MOCKS);
24
		serviceImage = mock(ImageService.class);
24
		serviceImage = mock(ImageService.class);
25
		ProtocoleService protocoleService = Mockito.mock(ProtocoleService.class);
25
		ObservationService obsService = Mockito.mock(ObservationService.class);
26
		resultatPresenteur = new ResultatPictofloraPresenteur(serviceImage, protocoleService, vueResultat);
26
		resultatPresenteur = new ResultatsIdentiplantePresenteur(obsService, vueResultat, "tout");
27
	}
27
	}
28
 
28
 
29
	@Test
29
	@Test
30
	public void testAfficherImages() {
30
	public void testAfficherImages() {
31
		resultatPresenteur.chargerEtAfficherImagesPageEnCours();
31
		resultatPresenteur.chercherEtAfficherObservationsPageEnCours();
32
		assertEquals(CacheClient.getInstance().getPageCouranteRechercheImage(), 1);
32
		assertEquals(CacheClient.getInstance().getPageCouranteRechercheImage(), 1);
33
	}
33
	}
34
 
34
 
35
}
35
}