Inital commit

This commit is contained in:
2022-02-24 01:07:09 +13:00
commit 8bc3cee328
55 changed files with 2292 additions and 0 deletions

37
models/model_test.go Normal file
View File

@@ -0,0 +1,37 @@
package models
import (
"testing"
)
func TestGetSession(t *testing.T) {
GetMongoSession()
}
func TestGetCollection(t *testing.T) {
GetCollection("test")
}
func TestCreate(t *testing.T) {
create("user", &User{Name: "Ale"})
}
func TestReadAll(t *testing.T) {
var u []User
readAll("user", "", nil, &u)
t.Log(u)
}
func TestRead(t *testing.T) {
var u User
read("user", "name", "Ann", &u)
t.Log(u)
}
func TestUpdate(t *testing.T) {
update("test", "name", "Ale", &User{Name: "Bob", Email: "z"})
}
func TestDelete(t *testing.T) {
t.Log(delete("user", "name", "Ann"))
}