@@ -93,3 +93,120 @@ func TestHeavyMagicMissileRune(t *testing.T) {
9393 assert .Equal (25 , hmmJson .Spells .Spell .RuneInformation .Level )
9494 assert .Equal (3 , hmmJson .Spells .Spell .RuneInformation .MagicLevel )
9595}
96+
97+ func TestAnnihilation (t * testing.T ) {
98+ data , err := os .ReadFile ("../testdata/spells/spell/Annihilation.html" )
99+ if err != nil {
100+ t .Errorf ("File reading error: %s" , err )
101+ return
102+ }
103+
104+ annihilationJson := TibiaSpellsSpellV3Impl ("Annihilation" , string (data ))
105+ assert := assert .New (t )
106+
107+ assert .Equal ("" , annihilationJson .Spells .Spell .Description )
108+ assert .Equal ("Annihilation" , annihilationJson .Spells .Spell .Name )
109+ assert .Equal ("annihilation" , annihilationJson .Spells .Spell .Spell )
110+ assert .True (annihilationJson .Spells .Spell .HasSpellInformation )
111+ assert .NotNil (annihilationJson .Spells .Spell .SpellInformation )
112+ assert .Equal ("exori gran ico" , annihilationJson .Spells .Spell .SpellInformation .Formula )
113+ assert .Equal (1 , len (annihilationJson .Spells .Spell .SpellInformation .Vocation ))
114+ assert .Equal ("Knight" , annihilationJson .Spells .Spell .SpellInformation .Vocation [0 ])
115+ assert .True (annihilationJson .Spells .Spell .SpellInformation .GroupAttack )
116+ assert .False (annihilationJson .Spells .Spell .SpellInformation .GroupHealing )
117+ assert .False (annihilationJson .Spells .Spell .SpellInformation .GroupSupport )
118+ assert .True (annihilationJson .Spells .Spell .SpellInformation .TypeInstant )
119+ assert .False (annihilationJson .Spells .Spell .SpellInformation .TypeRune )
120+ assert .Equal ("var." , annihilationJson .Spells .Spell .SpellInformation .DamageType ) // weird one..
121+ assert .Equal (30 , annihilationJson .Spells .Spell .SpellInformation .CooldownAlone )
122+ assert .Equal (4 , annihilationJson .Spells .Spell .SpellInformation .CooldownGroup )
123+ assert .Equal (0 , annihilationJson .Spells .Spell .SpellInformation .SoulPoints )
124+ assert .Equal (0 , annihilationJson .Spells .Spell .SpellInformation .Amount )
125+ assert .Equal (7 , len (annihilationJson .Spells .Spell .SpellInformation .City ))
126+ assert .True (annihilationJson .Spells .Spell .SpellInformation .Premium )
127+ assert .False (annihilationJson .Spells .Spell .HasRuneInformation )
128+ }
129+
130+ func TestBruiseBane (t * testing.T ) {
131+ data , err := os .ReadFile ("../testdata/spells/spell/Bruise Bane.html" )
132+ if err != nil {
133+ t .Errorf ("File reading error: %s" , err )
134+ return
135+ }
136+
137+ bruisebaneJson := TibiaSpellsSpellV3Impl ("Bruise Bane" , string (data ))
138+ assert := assert .New (t )
139+
140+ assert .Equal ("" , bruisebaneJson .Spells .Spell .Description )
141+ assert .Equal ("Bruise Bane" , bruisebaneJson .Spells .Spell .Name )
142+ assert .Equal ("bruise bane" , bruisebaneJson .Spells .Spell .Spell )
143+ assert .True (bruisebaneJson .Spells .Spell .HasSpellInformation )
144+ assert .NotNil (bruisebaneJson .Spells .Spell .SpellInformation )
145+ assert .Equal ("exura infir ico" , bruisebaneJson .Spells .Spell .SpellInformation .Formula )
146+ assert .Equal (1 , len (bruisebaneJson .Spells .Spell .SpellInformation .Vocation ))
147+ assert .False (bruisebaneJson .Spells .Spell .SpellInformation .GroupAttack )
148+ assert .True (bruisebaneJson .Spells .Spell .SpellInformation .GroupHealing )
149+ assert .False (bruisebaneJson .Spells .Spell .SpellInformation .GroupSupport )
150+ assert .True (bruisebaneJson .Spells .Spell .SpellInformation .TypeInstant )
151+ assert .False (bruisebaneJson .Spells .Spell .SpellInformation .TypeRune )
152+ assert .Equal (1 , bruisebaneJson .Spells .Spell .SpellInformation .CooldownAlone )
153+ assert .Equal (1 , bruisebaneJson .Spells .Spell .SpellInformation .CooldownGroup )
154+ assert .Equal (1 , bruisebaneJson .Spells .Spell .SpellInformation .Level )
155+ assert .Equal (10 , bruisebaneJson .Spells .Spell .SpellInformation .Mana )
156+ assert .Equal (0 , bruisebaneJson .Spells .Spell .SpellInformation .Price )
157+ assert .Equal (1 , len (bruisebaneJson .Spells .Spell .SpellInformation .City ))
158+ assert .Equal ("Dawnport" , bruisebaneJson .Spells .Spell .SpellInformation .City [0 ])
159+ assert .False (bruisebaneJson .Spells .Spell .SpellInformation .Premium )
160+ assert .False (bruisebaneJson .Spells .Spell .HasRuneInformation )
161+ }
162+
163+ func TestCurePoisonRune (t * testing.T ) {
164+ data , err := os .ReadFile ("../testdata/spells/spell/Cure Poison Rune.html" )
165+ if err != nil {
166+ t .Errorf ("File reading error: %s" , err )
167+ return
168+ }
169+
170+ curepoisonruneJson := TibiaSpellsSpellV3Impl ("Cure Poison Rune" , string (data ))
171+ assert := assert .New (t )
172+
173+ assert .Equal ("" , curepoisonruneJson .Spells .Spell .Description )
174+ assert .Equal ("Cure Poison Rune" , curepoisonruneJson .Spells .Spell .Name )
175+ assert .Equal ("cure poison rune" , curepoisonruneJson .Spells .Spell .Spell )
176+ assert .True (curepoisonruneJson .Spells .Spell .HasSpellInformation )
177+ assert .NotNil (curepoisonruneJson .Spells .Spell .SpellInformation )
178+ assert .Equal ("adana pox" , curepoisonruneJson .Spells .Spell .SpellInformation .Formula )
179+ assert .Equal (1 , len (curepoisonruneJson .Spells .Spell .SpellInformation .Vocation ))
180+ assert .False (curepoisonruneJson .Spells .Spell .SpellInformation .GroupAttack )
181+ assert .False (curepoisonruneJson .Spells .Spell .SpellInformation .GroupHealing )
182+ assert .True (curepoisonruneJson .Spells .Spell .SpellInformation .GroupSupport )
183+ assert .False (curepoisonruneJson .Spells .Spell .SpellInformation .TypeInstant )
184+ assert .True (curepoisonruneJson .Spells .Spell .SpellInformation .TypeRune )
185+ assert .False (curepoisonruneJson .Spells .Spell .SpellInformation .Premium )
186+ assert .True (curepoisonruneJson .Spells .Spell .HasRuneInformation )
187+ assert .False (curepoisonruneJson .Spells .Spell .RuneInformation .GroupAttack )
188+ assert .True (curepoisonruneJson .Spells .Spell .RuneInformation .GroupHealing )
189+ assert .False (curepoisonruneJson .Spells .Spell .RuneInformation .GroupSupport )
190+ }
191+
192+ func TestConvinceCreatureRune (t * testing.T ) {
193+ data , err := os .ReadFile ("../testdata/spells/spell/Convince Creature Rune.html" )
194+ if err != nil {
195+ t .Errorf ("File reading error: %s" , err )
196+ return
197+ }
198+
199+ convincecreatureruneJson := TibiaSpellsSpellV3Impl ("Convince Creature Rune" , string (data ))
200+ assert := assert .New (t )
201+
202+ assert .Equal ("" , convincecreatureruneJson .Spells .Spell .Description )
203+ assert .Equal ("Convince Creature Rune" , convincecreatureruneJson .Spells .Spell .Name )
204+ assert .Equal ("convince creature rune" , convincecreatureruneJson .Spells .Spell .Spell )
205+ assert .True (convincecreatureruneJson .Spells .Spell .HasSpellInformation )
206+ assert .NotNil (convincecreatureruneJson .Spells .Spell .SpellInformation )
207+ assert .Equal ("adeta sio" , convincecreatureruneJson .Spells .Spell .SpellInformation .Formula )
208+ assert .True (convincecreatureruneJson .Spells .Spell .HasRuneInformation )
209+ assert .False (convincecreatureruneJson .Spells .Spell .RuneInformation .GroupAttack )
210+ assert .False (convincecreatureruneJson .Spells .Spell .RuneInformation .GroupHealing )
211+ assert .True (convincecreatureruneJson .Spells .Spell .RuneInformation .GroupSupport )
212+ }
0 commit comments