This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package cursortoken
|
||||
|
||||
import (
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSortDirectionToMongoASC(t *testing.T) {
|
||||
tst.AssertEqual(t, SortASC.ToMongo(), 1)
|
||||
}
|
||||
|
||||
func TestSortDirectionToMongoDESC(t *testing.T) {
|
||||
tst.AssertEqual(t, SortDESC.ToMongo(), -1)
|
||||
}
|
||||
|
||||
func TestSortDirectionToMongoEmpty(t *testing.T) {
|
||||
var sd SortDirection
|
||||
tst.AssertEqual(t, sd.ToMongo(), 0)
|
||||
}
|
||||
|
||||
func TestSortDirectionToMongoUnknown(t *testing.T) {
|
||||
sd := SortDirection("xyz")
|
||||
tst.AssertEqual(t, sd.ToMongo(), 0)
|
||||
}
|
||||
|
||||
func TestSortDirectionConstants(t *testing.T) {
|
||||
tst.AssertEqual(t, string(SortASC), "ASC")
|
||||
tst.AssertEqual(t, string(SortDESC), "DESC")
|
||||
}
|
||||
Reference in New Issue
Block a user