Files
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

28 lines
624 B
Go

package vidser
import (
"testing"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func TestApplyScheduledVideoModuleID(t *testing.T) {
moduleID := primitive.NewObjectID()
update := bson.M{}
applyScheduledVideoModuleID(update, moduleID)
if got := update["mId"]; got != moduleID.Hex() {
t.Fatalf("mId = %v, want %s", got, moduleID.Hex())
}
}
func TestApplyScheduledVideoModuleIDIgnoresEmptyID(t *testing.T) {
update := bson.M{}
applyScheduledVideoModuleID(update, primitive.NilObjectID)
if _, ok := update["mId"]; ok {
t.Fatal("empty module id must not be written")
}
}