Introduction
I am making a kind of OCR application that needs to recognize characters based on pre-saved .bmp images of each character.
Now, for this part of the screen where I know there will be a symbol, I want to pass the current image to CharacterFactory, which will return a Character object:
class CharacterFactory : ICharacterFactory {
private Collection<Bitmap> aPictures = new HashTable<Bitmap>();
private Collection<Bitmap> bPictures = new HashTable<Bitmap>();
private Collection<Bitmap> cPictures = new HashTable<Bitmap>();
...
public CharacterFactory() {
LoadAllPictures();
}
...
public Character GetCharacter(Bitmap characterToRecognize) {
if (aPictures.Contains(characterToRecognize)) return new ACharacter();
if (bPictures.Contains(characterToRecognize)) return new BCharacter();
if (cPictures.Contains(characterToRecognize)) return new BCharacter();
...
}
}
My question
Unit Test ? , , - characterToRecognize , . , , GetCharacter().
, , CharacterFactory xPictures , .
?