feat:#36 added new event grpc message

This commit is contained in:
Elmar Kresse
2024-06-18 12:50:21 +02:00
parent 56e77630b5
commit 08140b5802
14 changed files with 510 additions and 50 deletions

View File

@@ -18,14 +18,13 @@ package db
import (
"github.com/pocketbase/dbx"
"htwkalender/data-manager/model"
"reflect"
"testing"
)
func Test_buildIcalQueryForModules(t *testing.T) {
type args struct {
modules []model.FeedCollection
modules []string
}
tests := []struct {
name string
@@ -34,17 +33,17 @@ func Test_buildIcalQueryForModules(t *testing.T) {
}{
{
name: "empty modules",
args: args{modules: []model.FeedCollection{}},
args: args{modules: []string{}},
want: dbx.HashExp{},
},
{
name: "one module",
args: args{modules: []model.FeedCollection{{Name: "test", Course: "test", UUID: "test"}}},
args: args{modules: []string{"test"}},
want: dbx.HashExp{"uuid": "test"},
},
{
name: "two modules",
args: args{modules: []model.FeedCollection{{Name: "test", Course: "test", UUID: "test"}, {Name: "test2", Course: "test2", UUID: "test2"}}},
args: args{modules: []string{"test", "test2"}},
want: dbx.Or(dbx.HashExp{"uuid": "test"}, dbx.HashExp{"uuid": "test2"}),
},
}