Created
January 5, 2017 14:39
-
-
Save illerax/d8b8536bb61f2dbb20e5b3d0672c54b4 to your computer and use it in GitHub Desktop.
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
package test | |
import com.illerax.randominit.RandomInit | |
class RandomInitTest extends GroovyTestCase { | |
void testRandomInitAnnotation() { | |
@RandomInit def exp | |
assert exp == null | |
@RandomInit Integer int1 | |
assert int1 != null | |
@RandomInit(min = -10, max = 10) Integer int2 | |
assert int2 >= -10 | |
assert int2 <= 10 | |
@RandomInit(min = -100, max = -50) Integer int3 | |
assert int3 >= -100 | |
assert int3 <= -50 | |
@RandomInit(min = 40, max = 100) BigDecimal dec1 | |
assert dec1 >= 40 | |
assert dec1 <= 100 | |
@RandomInit(min = 1, max = 1) BigDecimal dec2 | |
assert dec2 == 1 | |
@RandomInit(minLength = 3, maxLength = 3) String str1 | |
str1.size() == 3 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment