X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=core%2Ftest%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fclient%2Fresult%2FEmailAddressParsedResultTestCase.java;h=1611ea804574e126a41b069c5f8918e4dd3e4852;hb=HEAD;hp=c3fc5fdfe34142ceb3d54a74ae288d55f52a81ed;hpb=ac343e4ddc7af1f54c2d2634abb1be992d183a35;p=zxing.git diff --git a/core/test/src/com/google/zxing/client/result/EmailAddressParsedResultTestCase.java b/core/test/src/com/google/zxing/client/result/EmailAddressParsedResultTestCase.java index c3fc5fdf..1611ea80 100644 --- a/core/test/src/com/google/zxing/client/result/EmailAddressParsedResultTestCase.java +++ b/core/test/src/com/google/zxing/client/result/EmailAddressParsedResultTestCase.java @@ -18,20 +18,23 @@ package com.google.zxing.client.result; import com.google.zxing.BarcodeFormat; import com.google.zxing.Result; -import junit.framework.TestCase; +import org.junit.Assert; +import org.junit.Test; /** * Tests {@link EmailAddressParsedResult}. * * @author Sean Owen */ -public final class EmailAddressParsedResultTestCase extends TestCase { +public final class EmailAddressParsedResultTestCase extends Assert { + @Test public void testEmailAddress() { doTest("srowen@example.org", "srowen@example.org", null, null); doTest("mailto:srowen@example.org", "srowen@example.org", null, null); } + @Test public void testEmailDocomo() { doTest("MATMSG:TO:srowen@example.org;;", "srowen@example.org", null, null); doTest("MATMSG:TO:srowen@example.org;SUB:Stuff;;", "srowen@example.org", "Stuff", null); @@ -39,6 +42,14 @@ public final class EmailAddressParsedResultTestCase extends TestCase { "Stuff", "This is some text"); } + @Test + public void testSMTP() { + doTest("smtp:srowen@example.org", "srowen@example.org", null, null); + doTest("SMTP:srowen@example.org", "srowen@example.org", null, null); + doTest("smtp:srowen@example.org:foo", "srowen@example.org", "foo", null); + doTest("smtp:srowen@example.org:foo:bar", "srowen@example.org", "foo", "bar"); + } + private static void doTest(String contents, String email, String subject, String body) { Result fakeResult = new Result(contents, null, null, BarcodeFormat.QR_CODE); ParsedResult result = ResultParser.parseResult(fakeResult);