Add timeattack detector

This commit is contained in:
9seconds
2021-03-18 11:07:51 +03:00
parent 172b596cf1
commit f3112d4ba6
7 changed files with 124 additions and 12 deletions
+26
View File
@@ -0,0 +1,26 @@
package timeattack_test
import (
"testing"
"time"
"github.com/9seconds/mtg/v2/timeattack"
"github.com/stretchr/testify/suite"
)
type NoopTestSuite struct {
suite.Suite
}
func (suite *NoopTestSuite) TestOp() {
d := timeattack.NewNoop()
suite.NoError(d.Valid(time.Now()))
suite.NoError(d.Valid(time.Now().Add(time.Hour)))
suite.NoError(d.Valid(time.Now().Add(-time.Hour)))
}
func TestNoop(t *testing.T) {
t.Parallel()
suite.Run(t, &NoopTestSuite{})
}