Ejemplo n.º 1
0
func TestStartProgressForClueTeam(t *T) {
	beforeTeamProgressTest()
	err := table.StartProgress(3, 1)
	rdtest.Assert(t, err == nil, err)
	_, err = table.FindProgressByClueTeam(3, 1)
	rdtest.Assert(t, err == nil, err)
}
Ejemplo n.º 2
0
func TestFinishProgressForClueTeam(t *T) {
	beforeTeamProgressTest()

	now := time.Now()

	err := table.FinishProgressForClueTeam(now, 1, 1)
	rdtest.Assert(t, err == nil, err)

	p, err := table.FindProgressByClueTeam(1, 1)
	rdtest.Assert(t, err == nil, err)
	rdtest.Assert(
		t,
		int64(math.Abs(float64(p.AnswerTime.Time.Unix()-now.Unix()))) <= 1,
		"%d != %d", p.AnswerTime.Time.Unix(), now.Unix())
}