package events

import (
	"htwkalender/data-manager/model"
	"testing"
)

func TestContainsEvent(t *testing.T) {
	type args struct {
		events model.Events
		event  model.Event
	}
	tests := []struct {
		name string
		args args
		want bool
	}{
		{
			name: "contains event",
			args: args{
				events: model.Events{
					{
						UUID: "934807509832475",
						Name: "name",
					},
				},
				event: model.Event{
					UUID: "934807509832475",
					Name: "name",
				},
			},
			want: true,
		},
		{
			name: "contains no event",
			args: args{
				events: model.Events{
					{
						UUID: "9991929292921912343534",
						Name: "Name1",
					},
				},
				event: model.Event{
					UUID: "1111112312312312",
					Name: "Name2",
				},
			},
			want: false,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if got := containsEvent(tt.args.events, tt.args.event); got != tt.want {
				t.Errorf("containsEvent() = %v, want %v", got, tt.want)
			}
		})
	}
}
