-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/feature/508848-MostrarPreciosCom…
…bustibles' into develop
- Loading branch information
Showing
4 changed files
with
45 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 0 additions & 45 deletions
45
...idProject/app/src/test/java/es/unican/gasolineras/activities/common/UtilsHorarioTest.java
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
AndroidProject/app/src/test/java/es/unican/gasolineras/common/UtilsHorarioTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package es.unican.gasolineras.common; | ||
|
||
import static es.unican.gasolineras.common.UtilsHorario.gasolineraAbierta; | ||
import static es.unican.gasolineras.common.UtilsHorario.procesaHorario; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import java.time.LocalTime; | ||
|
||
import es.unican.gasolineras.activities.main.GasolinerasArrayAdapter; | ||
|
||
public class UtilsHorarioTest { | ||
|
||
private GasolinerasArrayAdapter adapter; | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
} | ||
|
||
@Test | ||
public void procesaHorarioTest() { | ||
Assert.assertEquals(procesaHorario("L-D: 08:00-21:00", "L"), "08:00-21:00"); | ||
Assert.assertEquals(procesaHorario("L-D: 08:00-14:00 y 16:00-22:00", "L"), "08:00-14:00 y 16:00-22:00"); | ||
Assert.assertEquals(procesaHorario("M-V: 08:00-21:00", "L"), "Todo el día"); | ||
Assert.assertEquals(procesaHorario("L-D: 24H", "L"), "24H"); | ||
Assert.assertEquals(procesaHorario("", "L"), "Sin detalles de horario"); | ||
} | ||
|
||
@Test | ||
public void gasolineraAbiertaTest(){ | ||
Assert.assertEquals(gasolineraAbierta("08:00-14:00 y 16:00-20:00", LocalTime.of(10, 00)), true); | ||
Assert.assertEquals(gasolineraAbierta("08:00-14:00 y 16:00-20:00", LocalTime.of(15, 00)), false); | ||
Assert.assertEquals(gasolineraAbierta("08:00-14:00 y 16:00-20:00", LocalTime.of(8, 00)), true); | ||
Assert.assertEquals(gasolineraAbierta("08:00-14:00 y 16:00-20:00", LocalTime.of(14, 00,00,1)), false); | ||
Assert.assertEquals(gasolineraAbierta("24H", LocalTime.of(10, 00)), true); | ||
Assert.assertEquals(gasolineraAbierta("Todo el día", LocalTime.of(10, 00)), false); | ||
Assert.assertEquals(gasolineraAbierta("Sin detalles de horario", LocalTime.of(10, 00)), false); | ||
|
||
|
||
} | ||
} |