[WIP] test: Add template test function to GetEventsSince

This commit is contained in:
ChronosX88 2019-08-18 18:56:16 +04:00
parent 3c61d0344f
commit cb76704a5e
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A

View File

@ -1,11 +1,13 @@
package memory package memory
import ( import (
"reflect"
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/signaller-matrix/signaller/internal"
"github.com/signaller-matrix/signaller/internal/models/createroom" "github.com/signaller-matrix/signaller/internal/models/createroom"
"github.com/signaller-matrix/signaller/internal/models/events"
"github.com/stretchr/testify/assert"
) )
func TestRegisterUser(t *testing.T) { func TestRegisterUser(t *testing.T) {
@ -188,3 +190,26 @@ func TestNewUserNameValidate(t *testing.T) {
assert.Nil(t, user) assert.Nil(t, user)
assert.Empty(t, token) assert.Empty(t, token)
} }
func TestGetEventsSince(t *testing.T) {
type args struct {
user internal.User
sinceToken string
limit int
}
tests := []struct {
name string
args args
want []events.Event
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
backend := NewBackend("localhost")
if got := backend.GetEventsSince(tt.args.user, tt.args.sinceToken, tt.args.limit); !reflect.DeepEqual(got, tt.want) {
t.Errorf("Backend.GetEventsSince() = %v, want %v", got, tt.want)
}
})
}
}