Initial commit

This commit is contained in:
yan.y
2024-03-27 23:25:08 +08:00
commit 0884384e91
127 changed files with 9353 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package mongodb
import (
"testing"
)
func TestIsExist(t *testing.T) {
t.Run("test mongodb config IsExist function", func(t *testing.T) {
if !IsExist() {
t.Errorf("config's files is not exist.")
}
})
t.Run("Test GetApplyURI function", func(t *testing.T) {
want := "mongodb://localhost:27017"
if applyUrl := CONFIG.GetApplyURI(); applyUrl != want {
t.Errorf("applyURI want %s but get %s", want, applyUrl)
}
})
t.Run("Test Remove function", func(t *testing.T) {
if err := Remove(); err != nil {
t.Error(err)
}
if IsExist() {
t.Errorf("config's files remove is fail.")
}
})
}