Add login
This commit is contained in:
@@ -17,7 +17,7 @@ const (
|
||||
const (
|
||||
TotalGestationPeriod = 15
|
||||
MinChild = 5
|
||||
MaxChild = 9
|
||||
MaxChild = 9
|
||||
GestationCooldown = (3 * 7) + 2
|
||||
GestationMinAge = 10 * 6
|
||||
MaxAge = 365 * 2
|
||||
|
||||
@@ -161,9 +161,9 @@ func TestHamster_Fuck(t *testing.T) {
|
||||
if tc.expectedResult {
|
||||
var female *Hamster
|
||||
if FEMALE == tc.hamster1.Sexe {
|
||||
female=tc.hamster1
|
||||
female = tc.hamster1
|
||||
} else {
|
||||
female=tc.hamster2
|
||||
female = tc.hamster2
|
||||
}
|
||||
if !female.Gestation {
|
||||
t.Errorf("Female is not in gestation")
|
||||
@@ -171,7 +171,7 @@ func TestHamster_Fuck(t *testing.T) {
|
||||
if female.GestationPeriod != 0 {
|
||||
t.Errorf("Gestation period doesn't have been reseted")
|
||||
}
|
||||
if female.GestationCooldown != TotalGestationPeriod + GestationCooldown {
|
||||
if female.GestationCooldown != TotalGestationPeriod+GestationCooldown {
|
||||
t.Errorf("Gestation period doesn't have been reseted")
|
||||
}
|
||||
}
|
||||
@@ -207,21 +207,20 @@ func TestBorn(t *testing.T) {
|
||||
|
||||
func Test_randSexe(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
want string
|
||||
name string
|
||||
want string
|
||||
fakeGen int
|
||||
}{
|
||||
{
|
||||
name: "Should be a male",
|
||||
name: "Should be a male",
|
||||
fakeGen: 1,
|
||||
want: MALE,
|
||||
want: MALE,
|
||||
},
|
||||
{
|
||||
name: "Should be a female",
|
||||
name: "Should be a female",
|
||||
fakeGen: 0,
|
||||
want: FEMALE,
|
||||
want: FEMALE,
|
||||
},
|
||||
|
||||
}
|
||||
for _, tt := range tests {
|
||||
randomizer.FakeRandomizer(tt.fakeGen)
|
||||
@@ -237,10 +236,10 @@ func Test_randNumber(t *testing.T) {
|
||||
max int
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
name string
|
||||
args args
|
||||
fakeGen int
|
||||
want int
|
||||
want int
|
||||
}{
|
||||
{
|
||||
name: "Should add min to result",
|
||||
@@ -249,7 +248,7 @@ func Test_randNumber(t *testing.T) {
|
||||
max: 2,
|
||||
},
|
||||
fakeGen: 0,
|
||||
want: 1,
|
||||
want: 1,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user