2026-01-04 11:38:13 +01:00
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestSkillBasisWert(t *testing.T) {
|
|
|
|
|
// Test that BasisWert defaults to 0 in master skill data
|
|
|
|
|
skill := Skill{
|
2026-01-29 09:49:36 +01:00
|
|
|
Name: "TestSkill",
|
|
|
|
|
GameSystemId: 1,
|
|
|
|
|
Initialwert: 5,
|
2026-01-04 11:38:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// BasisWert should default to 0
|
|
|
|
|
if skill.BasisWert != 0 {
|
|
|
|
|
t.Errorf("Expected BasisWert to default to 0, got %d", skill.BasisWert)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestSkillBasisWertSet(t *testing.T) {
|
|
|
|
|
// Test that BasisWert can be set in master skill data
|
|
|
|
|
skill := Skill{
|
2026-01-29 09:49:36 +01:00
|
|
|
Name: "TestSkill",
|
|
|
|
|
GameSystemId: 1,
|
|
|
|
|
Initialwert: 5,
|
|
|
|
|
BasisWert: 3,
|
2026-01-04 11:38:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if skill.BasisWert != 3 {
|
|
|
|
|
t.Errorf("Expected BasisWert to be 3, got %d", skill.BasisWert)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestWeaponSkillBasisWert(t *testing.T) {
|
|
|
|
|
// Test that BasisWert works for WeaponSkill (inherited from Skill)
|
|
|
|
|
weaponSkill := WeaponSkill{
|
|
|
|
|
Skill: Skill{
|
2026-01-29 09:49:36 +01:00
|
|
|
Name: "TestWeaponSkill",
|
|
|
|
|
GameSystemId: 1,
|
|
|
|
|
Initialwert: 5,
|
|
|
|
|
BasisWert: 2,
|
2026-01-04 11:38:13 +01:00
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if weaponSkill.BasisWert != 2 {
|
|
|
|
|
t.Errorf("Expected BasisWert to be 2, got %d", weaponSkill.BasisWert)
|
|
|
|
|
}
|
|
|
|
|
}
|