Quote:
|
Originariamente inviato da fek
Vi scrivo qui itest da implementare e far passare obbligatoriamente per ogni task.
Task 4
Codice:
void testLoadDiamondTexture()
{
Texture texture = new Texture("diamond");
assertTrue(texture.isLoaded(), "texture has not been loaded");
}
void testSize()
{
Texture texture = new Texture("diamond");
assertEqual(64, texture.getWidth(), "texture width is wrong");
assertEqual(64, texture.getHeight(), "texture width is wrong");
}
void testLoadFailed()
{
try
{
Texture texture = new Texture("this_texture_doesnt_exist");
}
catch (TextureNotFoundException)
{
return;
}
assertFail();
}
|
fek non mi è chiara una cosa. La stringa che passi al costruttore, dovrebbe essere il nome del file? No perché in tal caso bisogna specificare l'estensione e se così non fosse, cosa rappresenta quella stringa?