Skip to content

Commit

Permalink
Tests (#90)
Browse files Browse the repository at this point in the history
* tests

* clean up

* collection tests

---------

Co-authored-by: Maksym Bilan <>
  • Loading branch information
maximbilan authored Dec 25, 2024
1 parent 22798e3 commit 268946b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/database/collection_test.go
Original file line number Diff line number Diff line change
@@ -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())
}
}
}
13 changes: 13 additions & 0 deletions internal/database/role_test.go
Original file line number Diff line number Diff line change
@@ -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)
}
}

0 comments on commit 268946b

Please sign in to comment.