#Plano de testes para o desafio dojo
http://dojopuzzles.com/problemas/exibe/calculando-estatisticas-simples/
Entrada | Condição | Classe inválida | Classe válida | |
---|---|---|---|---|
$colecao | tipo: Collection | $colecao->items != int | $colecao->items == int | |
$colecao->count() <= 0 | $colecao->count() > 0 | |||
valor máximo está dentro da colecao | !$colecao->has($v_max) | $colecao->has($v_max) | ||
valor mínimo está dentro da colecao | !$colecao->has($v_min) | $colecao->has($v_min) |
isCollection($collection) === true
isCollection($string) === false
allElementsAreInt(Collection(1,2,3,4,5)) === true
allElementsAreInt(Collection("1",2,4,5)) === false
collectionSiteGTZero(Collection(1,2,3,4)) === true
collectionSiteGTZero(Collection()) === false
$maximo = 5;
maxInCollection(Collection(1,2,3,4,5))->has($maximo) === true
maxInCollection(Collection(1,2,3,4))->has($maximo) === false
$minimo = 1;
maxInCollection(Collection(1,2,3,4,5))->has($minimo) === true
maxInCollection(Collection(2,3,4,5))->has($minimo) === false