<commit_before>package uk.gov.dvla.core;

/**
 * Created with IntelliJ IDEA.
 * User: radekt
 * Date: 13/09/2013
 * Time: 10:49
 * To change this template use File | Settings | File Templates.
 */
public class TestValidators {
}<commit_msg>added tests for real this time<commit_after>package uk.gov.dvla.core;


import junit.framework.Assert;
import org.junit.Test;

public class TestValidators {

    @Test
    public void testDlnValidators() {
        String validDlns[] = {
                "LEESH702100C99DP", "KITSO802192GT2BD", "T9999812208B99DG",
                "TONY9810121MS2DB", "TYPEO606158A99QQ", "EXXXX811260EA9RE",
                "e9999811260EA9Re", "JAM99711268KA9OP" };

        String invalidDlns[] = {
                "LEE999702100C99DP", "KITSO802192GT1BD", "99999812208B99DG",
                "TON9810121MS2DB", "TYPE9O606158A99QQ", "EXXXX81T260EA9RE",
                "e9999811260E89Re", "JAM98711268KA90P" };

        for (String dln : validDlns) {
            Assert.assertTrue(
                    String.format("DLN [%s] incorrectly considered invalid", dln),
                    Validators.validateDln(dln));
        }

        for (String dln : invalidDlns) {
            Assert.assertFalse(
                    String.format("DLN [%s] incorrectly considered valid", dln),
                    Validators.validateDln(dln));
        }
    }
}
{'fraction_non_alphanumeric': 0.11038011695906433, 'fraction_numerical': 0.1154970760233918, 'mean_word_length': 2.355392156862745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '369423', 'n_tokens_mistral': 568, 'n_tokens_neox': 450, 'n_words': 86}