You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
869 B
Go
35 lines
869 B
Go
package model
|
|
|
|
import "testing"
|
|
|
|
func TestEnglishAdventureLogFallback_combatSwing(t *testing.T) {
|
|
got := EnglishAdventureLogFallback(&AdventureLogEvent{
|
|
Code: LogCombatSwing,
|
|
Args: map[string]any{
|
|
"source": "hero",
|
|
"outcome": "hit",
|
|
"damage": 12,
|
|
"isCrit": true,
|
|
"enemyType": "wolf_test_slug",
|
|
},
|
|
})
|
|
want := "You hit wolf_test_slug for 12 damage (crit)."
|
|
if got != want {
|
|
t.Fatalf("got %q want %q", got, want)
|
|
}
|
|
}
|
|
|
|
func TestEnglishAdventureLogFallback_heroRevived(t *testing.T) {
|
|
got := EnglishAdventureLogFallback(&AdventureLogEvent{Code: LogHeroRevived})
|
|
if got != "You revived." {
|
|
t.Fatalf("got %q", got)
|
|
}
|
|
}
|
|
|
|
func TestEnglishAdventureLogFallback_unknownCode(t *testing.T) {
|
|
got := EnglishAdventureLogFallback(&AdventureLogEvent{Code: "future_event_xyz"})
|
|
if got != "[future_event_xyz]" {
|
|
t.Fatalf("got %q", got)
|
|
}
|
|
}
|