forked from PokemonUnity/PokemonUnity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrainerTest.cs
More file actions
336 lines (295 loc) · 15 KB
/
Copy pathTrainerTest.cs
File metadata and controls
336 lines (295 loc) · 15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using PokemonUnity;
using PokemonUnity.Character;
using PokemonUnity.Monster;
namespace Tests
{
[TestClass]
public class TrainerTest
{
#region TrainerProperties
//public void Trainer_() {
// /*SaveDataOld.currentSave.playerName = name;
// SaveDataOld.currentSave.playerID = 29482; //not implemented
// SaveDataOld.currentSave.isMale = isMale;
// SaveDataOld.currentSave.playerMoney = 2481;
// SaveDataOld.currentSave.playerLanguage = Language.English;
//
// SaveDataOld.currentSave.playerOutfit = "hgss";
//
// SaveDataOld.currentSave.playerShirt = "Ethan's Shirt";
// SaveDataOld.currentSave.playerMisc = null;
// SaveDataOld.currentSave.playerHat = "Ethan's Hat";
// //customizables not implemented
//
// if(isMale == true){
// SaveDataOld.currentSave.setCVariable("male",1); //custom events can check if the player is male or female, 1 meaning male, 0 meaning female
// } else {
// SaveDataOld.currentSave.setCVariable("male",0);
// }*/
//}
#endregion
#region TrainerPokemon
[TestMethod]
public void Trainer_Party_GetPokemonCount()
{
TrainerData trainer = new TrainerData(TrainerTypes.PLAYER);
Player player = new Player(trainer);
int count = player.Party.GetCount();
//if (!count.HasValue) Assert.Fail("Party ");
//Assert.AreEqual(PokemonUnity.Core.MAXPARTYSIZE, count); //Should return a full party
Assert.AreEqual(0, count); //Should return an empty party
}
[TestMethod]
public void Trainer_Party_AddPokemon()
{
//Assert.Inconclusive();
string playerName = "Red";
int trainerID = 55323;
int secretID = 64123;
bool isMale = false;
TrainerData trainer = new TrainerData(playerName, isMale, tID: trainerID, sID: secretID);
Player player = new Player(trainer);
//player.addPokemon(new PokemonUnity.Monster.Pokemon(Pokemons.CHARMANDER, trainer));
PokemonUnity.Monster.Pokemon pkmn = new PokemonUnity.Monster.Pokemon(Pokemons.CHARMANDER);
pkmn.SetCatchInfos(trainer);
player.addPokemon(pkmn);
/*SaveDataOld.currentSave.PC.addPokemon(new PokemonOld(006, null, PokemonOld.Gender.CALCULATE, 3, true, "Poké Ball", "",
name,
Random.Range(0, 32), Random.Range(0, 32), Random.Range(0, 32), Random.Range(0, 32), Random.Range(0, 32),
Random.Range(0, 32),
0, 0, 0, 0, 0, 0, "ADAMANT", 0, PokemonDatabaseOld.getPokemon(6).GenerateMoveset(42), new int[4]));
SaveDataOld.currentSave.PC.addPokemon(new PokemonOld(197, PokemonOld.Gender.CALCULATE, 34, "Great Ball", "", name, 0));
SaveDataOld.currentSave.PC.addPokemon(new PokemonOld(393, PokemonOld.Gender.CALCULATE, 6, "Poké Ball", "", name, 0));
SaveDataOld.currentSave.PC.addPokemon(new PokemonOld(197, PokemonOld.Gender.CALCULATE, 28, "Great Ball", "", name, -1));
SaveDataOld.currentSave.PC.addPokemon(new PokemonOld(68, PokemonOld.Gender.CALCULATE, 37, "Ultra Ball", "", name, -1));
SaveDataOld.currentSave.PC.addPokemon(new PokemonOld(448, PokemonOld.Gender.CALCULATE, 56, "Great Ball", "", name, 0));
SaveDataOld.currentSave.PC.addPokemon(new PokemonOld(006, PokemonOld.Gender.CALCULATE, 37, "Poké Ball", "", name, 0));
SaveDataOld.currentSave.PC.addPokemon(new PokemonOld(607, PokemonOld.Gender.CALCULATE, 48, "Poké Ball", "", "Bob", 0));
SaveDataOld.currentSave.PC.boxes[1][1].addExp(7100);
SaveDataOld.currentSave.PC.addPokemon(new PokemonOld(157, PokemonOld.Gender.CALCULATE, 51, "Poké Ball", "", name, 0));
SaveDataOld.currentSave.PC.addPokemon(new PokemonOld(300, PokemonOld.Gender.CALCULATE, 51, "Poké Ball", "", name, 0));
SaveDataOld.currentSave.PC.addPokemon(new PokemonOld(393, "Surf Bloke", PokemonOld.Gender.MALE, 15, false, "Ultra Ball", //starters not implemented
"", name,
31, 31, 31, 31, 31, 31, 0, 252, 0, 0, 0, 252, "ADAMANT", 0,
new string[] {"Drill Peck", "Surf", "Growl", "Dragon Rage"}, new int[] {0, 0, 0, 3}));*/
CollectionAssert.AreNotEqual( //ToDo: Change to AreEqual, and use expected results with more precision...
new Pokemons[] { Pokemons.CHARMANDER, Pokemons.NONE, Pokemons.NONE, Pokemons.NONE, Pokemons.NONE, Pokemons.NONE },
new Pokemons[] { player.Party[0].Species, player.Party[1].Species, player.Party[2].Species, player.Party[3].Species, player.Party[4].Species, player.Party[5].Species }
);
}
[TestMethod]
public void Trainer_Party_AlterPokemon_InsideParty() {
/*SaveDataOld.currentSave.PC.boxes[0][1].setNickname("Greg");
SaveDataOld.currentSave.PC.boxes[0][1].setStatus(PokemonOld.Status.POISONED);
SaveDataOld.currentSave.PC.boxes[0][1].addExp(420);
SaveDataOld.currentSave.PC.boxes[0][0].swapHeldItem("Ultra Ball");
SaveDataOld.currentSave.PC.boxes[0][1].removeHP(56);
SaveDataOld.currentSave.PC.boxes[0][4].removeHP(64);
SaveDataOld.currentSave.PC.boxes[0][4].removePP(0, 5);
SaveDataOld.currentSave.PC.boxes[0][4].removePP(1, 5);
SaveDataOld.currentSave.PC.boxes[0][3].removePP(0, 6);
SaveDataOld.currentSave.PC.boxes[0][0].removePP(2, 11);
//PC.boxes[0][0].setStatus(Pokemon.Status.FROZEN);
SaveDataOld.currentSave.PC.boxes[0][2].setStatus(PokemonOld.Status.PARALYZED);
SaveDataOld.currentSave.PC.boxes[0][3].setStatus(PokemonOld.Status.BURNED);
SaveDataOld.currentSave.PC.boxes[0][4].setStatus(PokemonOld.Status.ASLEEP);*/
Assert.Inconclusive();
}
//[TestMethod]
//public void Trainer_Trade_Pokemons()
//{
// //Swap pokemons between owners, and confirm original pokemon owners are different
// Assert.Inconclusive();
//}
[TestMethod]
public void Trainer_Party_SwapPokemon() {
/*SaveDataOld.currentSave.PC.swapPokemon(0, 5, 1, 5);
SaveDataOld.currentSave.PC.swapPokemon(0, 3, 1, 11);
SaveDataOld.currentSave.PC.swapPokemon(1, 1, 1, 12);
SaveDataOld.currentSave.PC.swapPokemon(1, 2, 1, 21);
SaveDataOld.currentSave.PC.swapPokemon(0, 5, 1, 3);
SaveDataOld.currentSave.PC.swapPokemon(0, 2, 1, 4);
SaveDataOld.currentSave.PC.packParty();
SaveDataOld.currentSave.PC.swapPokemon(0, 0, 0, 2);
SaveDataOld.currentSave.PC.addPokemon(new PokemonOld(012, null, PokemonOld.Gender.CALCULATE, 35, false, "Great Ball", "",
name,
31, 31, 31, 31, 31, 31, 0, 252, 0, 0, 0, 252, "ADAMANT", 0,
new string[] {"Ominous Wind", "Sunny Day", "Gust", "Sleep Powder"}, new int[] {0, 0, 0, 0}));
//SaveData.currentSave.PC.swapPokemon(0,1,3,1);
SaveDataOld.currentSave.PC.swapPokemon(0, 2, 3, 2);
SaveDataOld.currentSave.PC.swapPokemon(0, 3, 3, 3);
SaveDataOld.currentSave.PC.swapPokemon(0, 4, 3, 4);
SaveDataOld.currentSave.PC.swapPokemon(0, 5, 3, 5);
SaveDataOld.currentSave.PC.packParty();*/
Assert.Inconclusive();
}
#endregion
#region TrainerItemsBags&&PC
[TestMethod]
public void Trainer_RideBike_Fail_If_Item_NotInInventory()
{
//if(
// Game.Player.Bag[PokemonUnity.Inventory.Items.BICYCLE] != null ||
// Game.Player.Bag[PokemonUnity.Inventory.Items.ACRO_BIKE] != null ||
// Game.Player.Bag[PokemonUnity.Inventory.Items.MACH_BIKE] != null
//)
Assert.Inconclusive();
}
[TestMethod]
public void Trainer_Bag_AddItems() {
/*SaveDataOld.currentSave.Bag.addItem("Poké Ball", 9);
SaveDataOld.currentSave.Bag.addItem("Miracle Seed", 1);
SaveDataOld.currentSave.Bag.addItem("Poké Ball", 3);
SaveDataOld.currentSave.Bag.addItem("Charcoal", 1);
SaveDataOld.currentSave.Bag.addItem("Potion", 4);
SaveDataOld.currentSave.Bag.addItem("Poké Doll", 13);
SaveDataOld.currentSave.Bag.addItem("Escape Rope", 4);
SaveDataOld.currentSave.Bag.addItem("Fire Stone", 2);
SaveDataOld.currentSave.Bag.removeItem("Poké Doll", 10);
SaveDataOld.currentSave.Bag.addItem("Stardust", 1);
SaveDataOld.currentSave.Bag.addItem("Water Stone", 1);
SaveDataOld.currentSave.Bag.addItem("Moon Stone", 1);
SaveDataOld.currentSave.Bag.addItem("Super Potion", 2);
SaveDataOld.currentSave.Bag.addItem("Great Ball", 4);
SaveDataOld.currentSave.Bag.addItem("Psyshock", 1);
SaveDataOld.currentSave.Bag.addItem("Bulk Up", 1);
SaveDataOld.currentSave.Bag.addItem("Elixir", 2);
SaveDataOld.currentSave.Bag.addItem("Ether", 1);
SaveDataOld.currentSave.Bag.addItem("Antidote", 1);
SaveDataOld.currentSave.Bag.addItem("Full Heal", 1);
SaveDataOld.currentSave.Bag.addItem("Rare Candy", 100);
SaveDataOld.currentSave.Bag.addItem("Paralyze Heal", 1);
SaveDataOld.currentSave.Bag.addItem("Awakening", 1);
SaveDataOld.currentSave.Bag.addItem("Burn Heal", 1);
SaveDataOld.currentSave.Bag.addItem("Ice Heal", 1);
SaveDataOld.currentSave.Bag.addItem("Max Potion", 1);
SaveDataOld.currentSave.Bag.addItem("Hyper Potion", 1);*/
Assert.Inconclusive();
}
[TestMethod]
public void Trainer_PC_AlterPokemon_InsideBox() {
/*SaveDataOld.currentSave.PC.boxes[0][1].setNickname("Greg");
SaveDataOld.currentSave.PC.boxes[0][1].setStatus(PokemonOld.Status.POISONED);
SaveDataOld.currentSave.PC.boxes[0][1].addExp(420);
SaveDataOld.currentSave.PC.boxes[0][0].swapHeldItem("Ultra Ball");
SaveDataOld.currentSave.PC.boxes[0][1].removeHP(56);
SaveDataOld.currentSave.PC.boxes[0][4].removeHP(64);
SaveDataOld.currentSave.PC.boxes[0][4].removePP(0, 5);
SaveDataOld.currentSave.PC.boxes[0][4].removePP(1, 5);
SaveDataOld.currentSave.PC.boxes[0][3].removePP(0, 6);
SaveDataOld.currentSave.PC.boxes[0][0].removePP(2, 11);
//PC.boxes[0][0].setStatus(Pokemon.Status.FROZEN);
SaveDataOld.currentSave.PC.boxes[0][2].setStatus(PokemonOld.Status.PARALYZED);
SaveDataOld.currentSave.PC.boxes[0][3].setStatus(PokemonOld.Status.BURNED);
SaveDataOld.currentSave.PC.boxes[0][4].setStatus(PokemonOld.Status.ASLEEP);*/
Assert.Inconclusive();
}
[TestMethod]
public void Trainer_PC_SwapPokemon() {
/*SaveDataOld.currentSave.PC.swapPokemon(0, 5, 1, 5);
SaveDataOld.currentSave.PC.swapPokemon(0, 3, 1, 11);
SaveDataOld.currentSave.PC.swapPokemon(1, 1, 1, 12);
SaveDataOld.currentSave.PC.swapPokemon(1, 2, 1, 21);
SaveDataOld.currentSave.PC.swapPokemon(0, 5, 1, 3);
SaveDataOld.currentSave.PC.swapPokemon(0, 2, 1, 4);
SaveDataOld.currentSave.PC.packParty();
SaveDataOld.currentSave.PC.swapPokemon(0, 0, 0, 2);
SaveDataOld.currentSave.PC.addPokemon(new PokemonOld(012, null, PokemonOld.Gender.CALCULATE, 35, false, "Great Ball", "",
name,
31, 31, 31, 31, 31, 31, 0, 252, 0, 0, 0, 252, "ADAMANT", 0,
new string[] {"Ominous Wind", "Sunny Day", "Gust", "Sleep Powder"}, new int[] {0, 0, 0, 0}));
//SaveData.currentSave.PC.swapPokemon(0,1,3,1);
SaveDataOld.currentSave.PC.swapPokemon(0, 2, 3, 2);
SaveDataOld.currentSave.PC.swapPokemon(0, 3, 3, 3);
SaveDataOld.currentSave.PC.swapPokemon(0, 4, 3, 4);
SaveDataOld.currentSave.PC.swapPokemon(0, 5, 3, 5);
SaveDataOld.currentSave.PC.packParty();*/
Player unkown = new Player();
//Pokemons p = Pokemons.ABOMASNOW;
unkown.PC.addPokemon(new Pokemon(Pokemons.ABOMASNOW));
//unkown.PC.Pokemons[0,0] = new Pokemon();
//unkown.PC[0].Pokemons[0] = new Pokemon();
unkown.PC.swapPokemon(0,0, 0,1); // 2nd pokemon in pc should be null
Assert.AreEqual(Pokemons.NONE, unkown.PC.Pokemons[0].Species); //last box used should be one checked
}
//[TestMethod]
//public void Trainer_PC_RenameBox() {
// //debug code to test custom box names/textures
// /*PC.boxName[1] = "Grassy Box";
// PC.boxTexture[2] = 12;*/
// Assert.Inconclusive();
//}
#endregion
#region TrainerSave
//[TestMethod] //Not needed anymore, being saved from Player
//public void Trainer_Save() {
// ////////////////////////////////////////////////////////////////////////////////////////////////////
// /* None of this is needed...
// //set file creation date
// string day = "";
// string month = "";
// if(System.DateTime.Now.Day == 1){day = "1st, ";}
// else if(System.DateTime.Now.Day == 2){day = "2nd, ";}
// else if(System.DateTime.Now.Day == 3){day = "3rd, ";}
// else if(System.DateTime.Now.Day == 21){day = "21st, ";}
// else if(System.DateTime.Now.Day == 22){day = "22nd, ";}
// else if(System.DateTime.Now.Day == 23){day = "23rd, ";}
// else if(System.DateTime.Now.Day == 31){day = "31st, ";}
// else{day = System.DateTime.Now.Day.ToString("D") + "th, ";}
//
// if(System.DateTime.Now.Month == 1){month = "Jan. ";}
// else if(System.DateTime.Now.Month == 2){month = "Feb. ";}
// else if(System.DateTime.Now.Month == 3){month = "Mar. ";}
// else if(System.DateTime.Now.Month == 4){month = "Apr. ";}
// else if(System.DateTime.Now.Month == 5){month = "May ";}
// else if(System.DateTime.Now.Month == 6){month = "June ";}
// else if(System.DateTime.Now.Month == 7){month = "July ";}
// else if(System.DateTime.Now.Month == 8){month = "Aug. ";}
// else if(System.DateTime.Now.Month == 9){month = "Sep. ";}
// else if(System.DateTime.Now.Month == 10){month = "Oct. ";}
// else if(System.DateTime.Now.Month == 11){month = "Nov. ";}
// else if(System.DateTime.Now.Month == 12){month = "Dec. ";} //probably the worst way to do this but I have no idea why ToString("MMM") doesn't work
//
// string date = month + day + System.DateTime.Now.Year;
//
// //SaveData.currentSave.fileCreationDate = "Aug. 2nd, 2017";
// SaveData.currentSave.fileCreationDate = date;*/
//
// ////////////////////////////////////////////////////////////////////////////////////////////////////
// /*
// //debug code to test trainer card/save
// SaveDataOld.currentSave.fileCreationDate = new System.DateTime(System.DateTime.Now.Year, 2, 14); //"Feb. 14th, 2015";
// SaveDataOld.currentSave.playerMoney = 2481;
// SaveDataOld.currentSave.playerScore = SaveDataOld.currentSave.pokedexCaught + "/" + SaveDataOld.currentSave.pokedexSeen;// PokemonDatabase.LoadPokedex().Length;//481;
// //SaveData.currentSave.pokeDex = 0;
//
// SaveDataOld.currentSave.playerHours = 0;
// SaveDataOld.currentSave.playerMinutes = 7;
// SaveDataOld.currentSave.playerSeconds = 12;
// SaveDataOld.currentSave.PlayTime = new System.TimeSpan(0,7,12);
//
// ////////////////////////////////////////////////////////////////////////////////////////////////////
//
// //debug code to test badge box
// SaveDataOld.currentSave.gymsEncountered = new bool[]
// {
// true, true, false, true, true, true,
// false, false, false, false, false, false
// };
// SaveDataOld.currentSave.gymsBeaten = new bool[]
// {
// true, true, false, false, false, true,
// false, false, false, false, false, false
// };*/
// //SaveDataOld.currentSave.gymsBeatTime = new System.DateTime?[]
// //{
// // new System.DateTime(System.DateTime.Now.Year, 4, 27) /*"Apr. 27th, 2015"*/, new System.DateTime(System.DateTime.Now.Year, 4, 30) /*"Apr. 30th, 2015"*/, null, null, null, new System.DateTime(System.DateTime.Now.Year, 5,1) /*"May. 1st, 2015"*/,
// // null, null, null, null, null, null
// //};
// Assert.Inconclusive();
//}
#endregion
}
}