<commit_before>package jp.toastkid.article.models;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Paths;
import java.util.HashMap;

import org.junit.Test;

import jp.toastkid.yobidashi.models.Defines;

/**
 * {@link Articles}' test case.
 *
 * @author <NAME>
 */
public class ArticlesTest {

    /**
     * {@link Articles#findByTitle(String)}' test case.
     */
    @Test
    public void test_findByTitle() {
        final Article article = Articles.findByTitle("日記_2017");
        assertEquals("日記_2017", article.title);
        assertEquals("file:///internal//md/C6FCB5AD5F32303137.md", article.toInternalUrl());
    }

    /**
     * {@link Articles#findByUrl(String)}' test case.
     */
    @Test
    public void test_findByUrl() {
        final Article article = Articles.findByUrl("file:///internal//md/C6FCB5AD5F32303137.md");
        assertEquals("日記_2017", article.title);
        assertEquals("file:///internal//md/C6FCB5AD5F32303137.md", article.toInternalUrl());
    }

    /**
     * {@link Articles#convertTitle(java.nio.file.Path)}' test case.
     * @throws URISyntaxException
     */
    @Test
    public void test_convertTitle() throws URISyntaxException {
        assertEquals("日記_2017年", Articles.convertTitle(
                Paths.get(new URI("file:///internal//md/C6FCB5AD5F32303137C7AF.md"))));
    }

    /**
     * Check {@link Articles#titleToFileName(String)}.
     */
    @Test
    public void test_titleToFileName() {
        final String titleToFileName = Articles.titleToFileName("トマト");
        assertEquals("A5C8A5DEA5C8", titleToFileName);
    }

    /**
     * Check {@link Articles#decodeBytedStr(String, String)}.
     */
    @Test
    public void test_decodeBytedStr() {
        final String decodeBytedStr = Articles.decodeBytedStr("A5C8A5DEA5C8", "EUC-JP");
        assertEquals("トマト", decodeBytedStr);
    }<commit_msg>modify test<commit_after>package jp.toastkid.article.models;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;

import org.junit.Test;

import jp.toastkid.yobidashi.models.Defines;

/**
 * {@link Articles}' test case.
 *
 * @author <NAME>
 */
public class ArticlesTest {

    /**
     * Check of {@link Articles#readAllArticleNames(String)}.
     */
    @Test
    public void test_readAllArticleNames() {
        final List<Article> articleNames = Articles.readAllArticleNames("src/test/resources/chart");
        assertEquals(4, articleNames.size());
    }

    /**
     * Check of {@link Articles#isInternalLink(String)}.
     */
    @Test
    public void test_isInternalLink() {
        assertFalse(Articles.isInternalLink("aaa"));;
        assertTrue(Articles.isInternalLink("file:///internal//md/C6FCB5AD5F32303137.md"));
    }

    /**
     * {@link Articles#findByTitle(String)}' test case.
     */
    @Test
    public void test_findByTitle() {
        final Article article = Articles.findByTitle("日記_2017");
        assertEquals("日記_2017", article.title);
        assertEquals("file:///internal//md/C6FCB5AD5F32303137.md", article.toInternalUrl());
    }

    /**
     * {@link Articles#findByUrl(String)}' test case.
     */
    @Test
    public void test_findByUrl() {
        final Article article = Articles.findByUrl("file:///internal//md/C6FCB5AD5F32303137.md");
        assertEquals("日記_2017", article.title);
        assertEquals("file:///internal//md/C6FCB5AD5F32303137.md", article.toInternalUrl());
    }

    /**
     * {@link Articles#convertTitle(java.nio.file.Path)}' test case.
     * @throws URISyntaxException
     */
    @Test
    public void test_convertTitle() throws URISyntaxException {
        assertEquals("日記_2017年", Articles.convertTitle(
                Paths.get(new URI("file:///internal//md/C6FCB5AD5F32303137C7AF.md"))));
        assertNull(Articles.convertTitle( Paths.get("")));
    }

    /**
     * Check {@link Articles#titleToFileName(String)}.
     */
    @Test
    public void test_titleToFileName() {
        final String titleToFileName = Articles.titleToFileName("トマト");
        assertEquals("A5C8A5DEA5C8", titleToFileName);
    }

    /**
     * Check {@link Articles#decodeBytedStr(String, String)}.
     */
    @Test
    public void test_decodeBytedStr() {
        final String decodeBytedStr = Articles.decodeBytedStr("A5C8A5DEA5C8", "EUC-JP");
        assertEquals("トマト", decodeBytedStr);
    }
{'fraction_non_alphanumeric': 0.1387489504617968, 'fraction_numerical': 0.03232577665827036, 'mean_word_length': 3.198237885462555, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '3519928', 'n_tokens_mistral': 1638, 'n_tokens_neox': 1525, 'n_words': 250}