-
Notifications
You must be signed in to change notification settings - Fork 511
Expand file tree
/
Copy pathGameTest.cs
More file actions
253 lines (236 loc) · 7.28 KB
/
GameTest.cs
File metadata and controls
253 lines (236 loc) · 7.28 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
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using PokemonUnity;
using PokemonUnity.Monster;
using PokemonUnity.Attack;
using PokemonUnity.Inventory;
using PokemonEssentials.Interface;
using PokemonEssentials.Interface.Battle;
using PokemonEssentials.Interface.Item;
using PokemonEssentials.Interface.Field;
using PokemonEssentials.Interface.Screen;
using PokemonEssentials.Interface.PokeBattle;
using PokemonEssentials.Interface.PokeBattle.Effects;
namespace Tests
{
[TestClass]
public class GameTest
{
//Test if Core.Rand Seed returns new value on each use
//Test if Core.Rand keeps the same seed value when bool is true
#region Data Loading and Tests
[TestMethod]
public void Initialize_Pokemon_Test()
{
Assert.IsTrue(Game.InitPokemons());
}
[TestMethod]
public void Pokemon_Data_IsLoaded()
{
Assert.IsTrue(Kernal.PokemonData.Count > 1);
}
[TestMethod]
public void Initialize_PokemonMoves_Test()
{
Assert.IsTrue(Game.InitPokemonMoves());
}
[TestMethod]
public void PokemonMoves_Data_IsLoaded()
{
Assert.IsTrue(Kernal.PokemonMovesData.Count > 1);
}
[TestMethod]
public void Initialize_PokemonEvolutions_Test()
{
Assert.IsTrue(Game.InitPokemonEvolutions());
}
[TestMethod]
public void PokemonEvolutions_Data_IsLoaded()
{
Assert.IsTrue(Kernal.PokemonEvolutionsData.Count > 1);
}
[TestMethod]
public void Initialize_PokemonForms_Test()
{
Assert.IsTrue(Game.InitPokemonForms());
}
[TestMethod]
public void PokemonForms_Data_IsLoaded()
{
Assert.IsTrue(Kernal.PokemonFormsData.Count > 1);
}
[TestMethod]
public void Initialize_PokemonItems_Test()
{
Assert.IsTrue(Game.InitPokemonItems());
}
[TestMethod]
public void PokemonItems_Data_IsLoaded()
{
Assert.IsTrue(Kernal.PokemonItemsData.Count > 1);
}
[TestMethod]
public void Initialize_Natures_Test()
{
Assert.IsTrue(Game.InitNatures(), string.Format("NatureData: {0}", Kernal.NatureData.Count.ToString()));
}
[TestMethod]
public void Natures_Data_IsLoaded()
{
Assert.IsTrue(Kernal.NatureData.Count > 1, string.Format("NatureData: {0}", Kernal.NatureData.Count.ToString()));
}
[TestMethod]
public void Initialize_Moves_Test()
{
Assert.IsTrue(Game.InitMoves(), string.Format("MoveData: {0} | MoveMetaData: {1}", Kernal.MoveData.Count.ToString(), Kernal.MoveMetaData.Count.ToString()));
}
[TestMethod]
public void Moves_Data_IsLoaded()
{
Assert.IsTrue(Kernal.MoveData.Count > 1, string.Format("MoveData: {0} | MoveMetaData: {1}", Kernal.MoveData.Count.ToString(), Kernal.MoveMetaData.Count.ToString()));
}
[TestMethod]
public void Initialize_Items_Test()
{
Assert.IsTrue(Game.InitItems(), string.Format("ItemData: {0}", Kernal.ItemData.Count.ToString()));
}
[TestMethod]
public void Items_Data_IsLoaded()
{
Assert.IsTrue(Kernal.ItemData.Count > 1, string.Format("ItemData: {0}", Kernal.ItemData.Count.ToString()));
}
[TestMethod]
public void Initialize_Berries_Test()
{
Assert.IsTrue(Game.InitBerries(), string.Format("BerryData: {0}", Kernal.BerryData.Count.ToString()));
}
[TestMethod]
public void Berries_Data_IsLoaded()
{
Assert.IsTrue(Kernal.BerryData.Count > 1, string.Format("BerryData: {0}", Kernal.BerryData.Count.ToString()));
}
[TestMethod]
public void Initialize_Regions_Test()
{
Assert.IsTrue(Game.InitRegions(), string.Format("RegionData: {0}", Kernal.RegionData.Count.ToString()));
}
[TestMethod]
public void Regions_Data_IsLoaded()
{
Assert.IsTrue(Kernal.RegionData.Count > 1, string.Format("RegionData: {0}", Kernal.RegionData.Count.ToString()));
}
[TestMethod]
public void Initialize_Types_Test()
{
Assert.IsTrue(Game.InitTypes(), string.Format("TypeData: {0}", Kernal.TypeData.Count.ToString()));
}
[TestMethod]
public void Types_Data_IsLoaded()
{
Assert.IsTrue(Kernal.TypeData.Count > 1, string.Format("TypeData: {0}", Kernal.TypeData.Count.ToString()));
}
[TestMethod]
public void Initialize_Locations_Test()
{
Assert.IsTrue(Game.InitLocations(), string.Format("LocationData: {0} | AreaData: {1}", Kernal.LocationData.Count.ToString(), Kernal.AreaData.Count.ToString()));
}
[TestMethod]
public void Locations_Data_IsLoaded()
{
Assert.IsTrue(Kernal.LocationData.Count > 1, string.Format("LocationData: {0} | AreaData: {1}", Kernal.LocationData.Count.ToString(), Kernal.AreaData.Count.ToString()));
}
[TestMethod]
public void Initialize_Encounters_Test()
{
//Set Area Id THEN Test if Encounters loaded
Assert.IsTrue(Game.InitEncounters(), string.Format("EncounterData: {0} | MethodData: {1}", Kernal.EncounterData.Count.ToString(), Kernal.MethodData.Count.ToString()));
}
[TestMethod]
public void Encounters_Data_IsLoaded()
{
//Set Area Id THEN Test if Encounters loaded
//Assert.IsTrue(Game.EncounterData.Count > 1, string.Format("EncounterData: {0} | MethodData: {1}",Game.EncounterData.Count.ToString(), Game.MethodData.Count.ToString()));
Assert.Inconclusive("Set Area Id THEN Test if Encounters loaded");
}
[TestMethod]
public void Initialize_Trainers_Test()
{
Assert.IsTrue(Game.InitTrainers(), string.Format("TrainerMetaData: {0}", Kernal.TrainerMetaData.Count.ToString()));
}
[TestMethod]
public void Trainers_Data_IsLoaded()
{
Assert.IsTrue(Kernal.TrainerMetaData.Count > 1, string.Format("TrainerMetaData: {0}", Kernal.TrainerMetaData.Count.ToString()));
}
#endregion
#region PlayerMovement
//[TestMethod]
//public void Test_UseBike_While_SurfOrFly_Fails()
//{
// Assert.Inconclusive();
//}
//[TestMethod]
//public void Test_UseBike_While_Surf_Fails()
//{
// Assert.Inconclusive();
//}
[TestMethod]
public void TestWarpToValidMap()
{
IGame game = new Game();
// Assuming MapLister and DefaultMap are mockable or have predictable behavior
// and that WarpToMap returns a non-null ITilePosition when successful
ITilePosition result = game.WarpToMap();
Assert.IsNotNull(result, "Warping to a valid map should return a non-null ITilePosition.");
}
#endregion
#region SaveData
private static string _SaveStateFromFile { get; set; }
/// <summary>
/// Create Dummy Data and Save to File
/// </summary>
static GameTest()
{
//Create 3 SaveState of Dummy Data
//Save to File
//Game.Save();
//Delete one
}
/// <summary>
/// Test will confirm if saving content to file without error will pass or fail
/// Other test will confirm if data can be read without errors
/// </summary>
public void Save_GameState_Data()
{
//FrameworkTest creates a save file identical to this
//If this method's save file is equal to _SaveStateFromFile
//Confirm remaining 2 SaveState
}
public void Delete_Save_Data_From_SaveFile()
{
}
public void Load_Pokemon_Data_From_SaveFile()
{
}
public void Load_PC_Data_From_SaveFile()
{
}
public void Load_Party_Data_From_SaveFile()
{
}
public void Load_SaveStateVersion_Data_From_SaveFile()
{
}
#endregion
#region Misc
[TestMethod]
public void Test_SeriPokemon_To_Pokemon()
{
PokemonUnity.Monster.Pokemon pkmn = new PokemonUnity.Monster.Pokemon(PokemonUnity.Pokemons.ABRA);
PokemonUnity.Saving.SerializableClasses.SeriPokemon seri = pkmn;
PokemonUnity.Monster.Pokemon p = seri;
Assert.AreEqual<PokemonUnity.Monster.Pokemon>(pkmn, p);
}
#endregion
}
}