<commit_before>package com.soctec.soctec.test;

import android.test.InstrumentationTestCase;

import com.soctec.soctec.achievements.AchievementCreator;
import com.soctec.soctec.achievements.AchievementUnlocker;
import com.soctec.soctec.core.MainActivity;
import com.soctec.soctec.achievements.Stats;
/**
 * Created by <NAME> on 2015-09-29.
 */
public class AchievementTest extends InstrumentationTestCase
{
    MainActivity main = new MainActivity();
    Stats stats = new Stats();
    AchievementCreator creator = new AchievementCreator (main);
    AchievementUnlocker unlocker = new AchievementUnlocker (stats, creator);

    /**
     * Tests if its possible to create an Achievement by checking the unlockedAchievements-list after
     * trying to create one.
     * @throws Exception
     */
    public void testCreateAchievement () throws Exception
    {
        creator.addObserver(unlocker);
        unlocker.invokeTestAchievement();
        assertEquals( 1, unlocker.getUnlockableAchievements().size());
    }

    /**
     * Checks if the scancount gets increased when a scan har occured (A fake scan)
     * @throws Exception
     */
    public void testScanCountInc () throws Exception
    {
        creator.addObserver(unlocker);
        unlocker.invokeTestAchievement();
        unlocker.receiveEvent(1, "JOCKE");
        assertEquals(stats.getScanCount(), 1);

    }

    /**
     * Checks if the LastScanned-String object is the same as the one received from the "fake" scan.
     * @throws Exception
     */
    public void testLastScanned () throws Exception
    {
        creator.addObserver(unlocker);
        unlocker.invokeTestAchievement();
        unlocker.receiveEvent(1, "JOCKE");
        assertEquals("JOCKE", stats.getlastScanned());
    }

    /**
     * Checks if a list containing one achievement gets emptied when that achievement gets unlocked.
     * @throws Exception
     */
    public void testUnlockAchievement () throws Exception
    {
        creator.addObserver(unlocker);
        unlocker.invokeTestAchievement();
        unlocker.receiveEvent(1, "JOCKE");
        assertEquals(0, unlocker.getUnlockableAchievements().size());
    }

}
<commit_msg>Corrected a comment, added todo<commit_after>package com.soctec.soctec.test;

import android.test.InstrumentationTestCase;

import com.soctec.soctec.achievements.AchievementCreator;
import com.soctec.soctec.achievements.AchievementUnlocker;
import com.soctec.soctec.core.MainActivity;
import com.soctec.soctec.achievements.Stats;
/**
 * Created by <NAME> on 2015-09-29.
 */
public class AchievementTest extends InstrumentationTestCase
{
    MainActivity main = new MainActivity();
    Stats stats = new Stats();
    AchievementCreator creator = new AchievementCreator (main);
    AchievementUnlocker unlocker = new AchievementUnlocker (stats, creator);

    /**
     * Tests if its possible to create an Achievement by checking the unlockedAchievements-list after
     * trying to create one.
     * @throws Exception
     */
    public void testCreateAchievement () throws Exception
    {
        creator.addObserver(unlocker);
        unlocker.invokeTestAchievement();
        assertEquals( 1, unlocker.getUnlockableAchievements().size());
    }

    /**
     * Checks if the scancount gets increased when a scan has occured (A fake scan)
     * @throws Exception
     */
    public void testScanCountInc () throws Exception
    {
        creator.addObserver(unlocker);
        unlocker.invokeTestAchievement();
        unlocker.receiveEvent(1, "JOCKE");
        assertEquals(stats.getScanCount(), 1);

    }

    /**
     * Checks if the LastScanned-String object is the same as the one received from the "fake" scan.
     * @throws Exception
     */
    public void testLastScanned () throws Exception
    {
        creator.addObserver(unlocker);
        unlocker.invokeTestAchievement();
        unlocker.receiveEvent(1, "JOCKE");
        assertEquals("JOCKE", stats.getlastScanned());
    }
    /**
     * Checks if a list containing one achievement gets emptied when that achievement gets unlocked.
     * @throws Exception
     */
    public void testUnlockAchievement () throws Exception
    {
        creator.addObserver(unlocker);
        unlocker.invokeTestAchievement();
        unlocker.receiveEvent(1, "JOCKE");
        assertEquals(0, unlocker.getUnlockableAchievements().size());
    }

    //TODO : Write more tests, what kind of tests?

}

{'fraction_non_alphanumeric': 0.09444569372610749, 'fraction_numerical': 0.006296379581740499, 'mean_word_length': 3.180451127819549, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1790510', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1259, 'n_words': 318}