View Single Post
Old 19-09-2005, 14:30   #18
Vifani
Senior Member
 
Iscritto dal: Apr 2001
Città: Bari
Messaggi: 2776
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?
__________________
Raffaele Fanizzi
My Personal Web Site
Membro Jedi del HWU Star Wars Clan
Vifani è offline