Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.68 KB | None | 0 0
  1.     void testHabilitadoCompra() {
  2.         [[unMesAntes,       "El evento aun no ha pasado",   true],
  3.          [unaSemanaAntes,   "Falta una semana",             true],
  4.          [tresDiasAntes,    "Faltan tres días",
  5.          [unMinutoAntes,    "Falta un minuto",              false],
  6.          [fechaEvento,      "El evento es *ya*",            false],
  7.          [unMinutoDespues,  "Acaba de pasar",               false],
  8.          [unDiaDespues,     "Evento fue ayer",              false],
  9.          ].each {now, msg, val ->
  10.             DateTimeUtils.withCurrentMillisFixed(now.millis) {
  11.                 assertEquals msg, val, evento.habilitadoCompra()
  12.             }
  13.         }
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement