[bisq-network/bisq] Validate phone numbers (#3134)

battleofwizards notifications at github.com
Sat Aug 24 20:33:43 UTC 2019

battleofwizards commented on this pull request.

> +import static org.junit.Assert.assertTrue;
+public class PhoneNumberValidatorTest {
+    private PhoneNumberValidator validator;
+    private ValidationResult validationResult;
+    @Before
+    public void setup() {
+        Res.setup();
+    }
+    @Test
+    public void testNoInput() {
+        validator = new PhoneNumberValidator("AT");
+        validationResult = validator.validate("");
+        assertFalse("'' should not be a valid number in AT", validationResult.isValid);

Most importantly it is very nice you provided comprehensive unit tests. I am perfectly okay with your original version as it is already superior to what we have in the project (tests missing).

But please consider: tests like any code should be about intent and essence, not technical details. Good tests rarely use raw assertions directly. Framework assertions are just the building blocks for your meaningful ones.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190824/37b7e894/attachment.html>

More information about the bisq-github mailing list