User - robertome/IWVG.SwC.RobertoMartin GitHub Wiki
almacena un identificador, el nombre y apellido, controlando el formato del mismo y mostrando diferentes representaciones
Ampliaciones:
Ampliación 1. Control de parámetros del constructor.
Dado el constructor User(int number, String name, String familyName)
, no permitir valores nulos o vacios ("") lanzando una excepcion java.lang.IllegalArgumentException
Test aceptación
- testUserWithNameNull()
Usuario con name=null
-> Resultado java.lang.IllegalArgumentException
con texto "Field 'name' MUST NOT be null or empty"
- testUserWithFamilyNameEmpty()
Usuario con familyName=""
-> Resultado java.lang.IllegalArgumentException
con texto "Field 'familyName' MUST NOT be null or empty"