fix:#25 changed course updater insert and delete procedure

This commit is contained in:
Elmar Kresse
2024-04-21 11:59:20 +02:00
parent e13dad48b4
commit c8bcc3be94
4 changed files with 100 additions and 108 deletions

View File

@@ -75,28 +75,17 @@ func Test_extractSemesterAndYear(t *testing.T) {
func Test_replaceEmptyEventNames(t *testing.T) {
type args struct {
groups []model.SeminarGroup
group model.SeminarGroup
}
tests := []struct {
name string
args args
want []model.SeminarGroup
want model.SeminarGroup
}{
{
name: "Test 1",
args: args{
groups: []model.SeminarGroup{
{
Events: []model.Event{
{
Name: "Test",
},
},
},
},
},
want: []model.SeminarGroup{
{
group: model.SeminarGroup{
Events: []model.Event{
{
Name: "Test",
@@ -104,26 +93,29 @@ func Test_replaceEmptyEventNames(t *testing.T) {
},
},
},
want: model.SeminarGroup{
Events: []model.Event{
{
Name: "Test",
},
},
},
},
{
name: "Test 1",
args: args{
groups: []model.SeminarGroup{
{
Events: []model.Event{
{
Name: "",
},
group: model.SeminarGroup{
Events: []model.Event{
{
Name: "",
},
},
},
},
want: []model.SeminarGroup{
{
Events: []model.Event{
{
Name: "Sonderveranstaltungen",
},
want: model.SeminarGroup{
Events: []model.Event{
{
Name: "Sonderveranstaltungen",
},
},
},
@@ -131,7 +123,7 @@ func Test_replaceEmptyEventNames(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := ReplaceEmptyEventNames(tt.args.groups); !reflect.DeepEqual(got, tt.want) {
if got := ReplaceEmptyEventNames(tt.args.group); !reflect.DeepEqual(got, tt.want) {
t.Errorf("ReplaceEmptyEventNames() = %v, want %v", got, tt.want)
}
})