feat: add unit test

This commit is contained in:
2019-09-20 01:57:35 +02:00
parent 779cd1da6e
commit dc396a300f
3 changed files with 40 additions and 61 deletions

View File

@@ -17,7 +17,7 @@ const (
const (
TotalGestationPeriod = 15
MinChild = 5
MaxCild = 9
MaxChild = 9
GestationCooldown = (3 * 7) + 2
GestationMinAge = 10 * 6
MaxAge = 365 * 2
@@ -114,7 +114,7 @@ func Born(father *Hamster, mother *Hamster) ([]*Hamster, error) {
}
func randNumberChild() int {
return randNumber(MinChild, MaxCild)
return randNumber(MinChild, MaxChild)
}
func randSexe() string {
@@ -128,5 +128,5 @@ func randSexe() string {
}
func randNumber(min int, max int) int {
return min + randomizer.Rand(max-min)
return min + randomizer.Rand(max)
}