1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package com.octo.captcha.sound.speller;
19
20 import com.octo.captcha.CaptchaException;
21 import com.octo.captcha.component.word.worddecorator.SpellerWordDecorator;
22 import com.octo.captcha.component.word.wordgenerator.RandomWordGenerator;
23 import com.octo.captcha.sound.WordToSoundMock;
24 import junit.framework.TestCase;
25
26 public class SpellerSoundFactoryTest extends TestCase {
27
28 public void testSpellerSoundFactory() throws Exception {
29 try {
30 new SpellerSoundFactory(null, null, null);
31 fail("Test is not implemented");
32 } catch (CaptchaException e) {
33 assertNotNull(e.getMessage());
34 }
35 try {
36 new SpellerSoundFactory(new RandomWordGenerator("a"), null, null);
37 fail("Test is not implemented");
38 } catch (CaptchaException e) {
39 assertNotNull(e.getMessage());
40 }
41
42 try {
43 new SpellerSoundFactory(null, new WordToSoundMock(), null);
44 fail("Test is not implemented");
45 } catch (CaptchaException e) {
46 assertNotNull(e.getMessage());
47 }
48 }
49
50
51 public void testGetSoundCaptcha() throws Exception {
52 SpellerSoundFactory tested = new SpellerSoundFactory(new RandomWordGenerator("a"), new WordToSoundMock(), new SpellerWordDecorator(";"));
53 assertNotNull(tested.getSoundCaptcha());
54 assertNotNull(tested.getSoundCaptcha().getChallenge());
55 assertNotNull(tested.getSoundCaptcha().getQuestion());
56 }
57 }