mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-09-12 06:18:27 +00:00
Implement atomic UpdatePortfolio with retry pattern for concurrent-safe updates. Add CAS support to DynamoDB, Firestore, Memory, and prefix stores.
25 lines
630 B
Go
25 lines
630 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/tiennm99/miti99bot/internal/modules"
|
|
"github.com/tiennm99/miti99bot/internal/storage"
|
|
)
|
|
|
|
func TestFactoriesIncludesGold(t *testing.T) {
|
|
catalog := factories()
|
|
if catalog["gold"] == nil {
|
|
t.Fatal("factories missing gold")
|
|
}
|
|
reg, err := modules.Build([]string{"gold"}, catalog, storage.NewMemoryProvider(), modules.BuildOptions{})
|
|
if err != nil {
|
|
t.Fatalf("Build gold: %v", err)
|
|
}
|
|
for _, name := range []string{"gold_price", "gold_topup", "gold_buy", "gold_sell", "gold_stats"} {
|
|
if _, ok := reg.AllCommands[name]; !ok {
|
|
t.Fatalf("missing command %s", name)
|
|
}
|
|
}
|
|
}
|