diff --git a/internal/database/collection_test.go b/internal/database/collection_test.go new file mode 100644 index 0000000..88b6d40 --- /dev/null +++ b/internal/database/collection_test.go @@ -0,0 +1,12 @@ +package database + +import "testing" + +func TestCollections(t *testing.T) { + collections := []Collection{Users, Notes, Feedbacks, Updates} + for _, collection := range collections { + if collection.String() != string(collection) { + t.Fatalf("Expected %v, got %v", collection, collection.String()) + } + } +} diff --git a/internal/database/role_test.go b/internal/database/role_test.go new file mode 100644 index 0000000..0c33d43 --- /dev/null +++ b/internal/database/role_test.go @@ -0,0 +1,13 @@ +package database + +import ( + "testing" +) + +func TestIsAdmin(t *testing.T) { + role := Admin + result := IsAdmin(&role) + if result != true { + t.Fatalf("Expected true, got %v", result) + } +}