oid64/oid64_test.go
2023-08-03 17:25:00 +02:00

32 lines
586 B
Go

package oid64
import "testing"
func TestObjectIDToBase64(t *testing.T) {
in := "507f191e810c19729de860ea"
exOut := "UH8ZHoEMGXKd6GDq"
out, e := ObjectIDToBase64(in)
if e != nil {
t.Fatal(e.Error())
}
if out != exOut {
t.Logf("Results don't match. Expected %s got %s", exOut, out)
t.Fail()
}
}
func TestBase64ToObjectID(t *testing.T) {
in := "UH8ZHoEMGXKd6GDq"
exOut := "507f191e810c19729de860ea"
out, e := Base64ToObjectID(in)
if e != nil {
t.Fatal(e.Error())
}
if out != exOut {
t.Logf("Results don't match. Expected %s got %s", exOut, out)
t.Fail()
}
}