1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/java/SuperPostak/test/cz/frantovo/superPostak/PostakTest.java Sun Nov 23 22:19:20 2008 +0100
1.3 @@ -0,0 +1,31 @@
1.4 +package cz.frantovo.superPostak;
1.5 +
1.6 +import cz.frantovo.postak.Postak;
1.7 +import org.junit.Test;
1.8 +import static org.junit.Assert.*;
1.9 +
1.10 +/**
1.11 + * @author fiki
1.12 + */
1.13 +public class PostakTest {
1.14 +
1.15 + @Test
1.16 + public void zkontrolujAdresu() {
1.17 + System.out.println("zkontrolujAdresu");
1.18 +
1.19 + String[] adresyDobre = {"abcd@example.com", "aa.bb@seznam.cz", "nbusr123@example.name", "VeLkA@pIsMeNa.COM"};
1.20 + String[] adresySpatne = {"adresaATexampleDOTcom", "nějaká adresa", "adresa @seznam.cz"};
1.21 +
1.22 + for (String adresa : adresyDobre) {
1.23 + System.out.println("Kontroluji: " + adresa);
1.24 + assertEquals(true, Postak.zkontrolujAdresu(adresa));
1.25 + }
1.26 +
1.27 + System.out.println();
1.28 +
1.29 + for (String adresa : adresySpatne) {
1.30 + System.out.println("Kontroluji: " + adresa);
1.31 + assertEquals(false, Postak.zkontrolujAdresu(adresa));
1.32 + }
1.33 + }
1.34 +}