<commit_before>package com.ptc.taskanalyse.repos.memory;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.ptc.taskanalyse.models.TaskDurationInfo;
import com.ptc.taskanalyse.repos.TaskRepository;
import com.ptc.taskanalyse.services.TaskService;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 * Created by asasmaz on 22/05/2017.
 */
public class MemoryTaskRepositoryTest {

    private TaskRepository repo;

    @Before
    public void runBeforeTestMethod() {
        repo = new MemoryTaskRepository(new ObjectMapper());
    }

    @Test
    public void setPerformed() throws Exception {
        int numOfFinishedTasks = repo.getDurationInfo(1).getNumOfFinishedTasks();
        Assert.assertEquals("There should be no finished tasks, yet", 0, numOfFinishedTasks, 0);

        repo.setPerformed(1, 5);

        numOfFinishedTasks = repo.getDurationInfo(1).getNumOfFinishedTasks();
        Assert.assertEquals("There should be 1 finished task now", 1, numOfFinishedTasks, 0);
    }<commit_msg>Increase test checks for MemoryTaskRepository.setPerformed()<commit_after>package com.ptc.taskanalyse.repos.memory;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.ptc.taskanalyse.models.TaskDurationInfo;
import com.ptc.taskanalyse.repos.TaskRepository;
import com.ptc.taskanalyse.services.TaskService;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 * Created by asasmaz on 22/05/2017.
 */
public class MemoryTaskRepositoryTest {

    private TaskRepository repo;

    @Before
    public void runBeforeTestMethod() {
        repo = new MemoryTaskRepository(new ObjectMapper());
    }

    @Test
    public void setPerformed() throws Exception {
        int numOfFinishedTasks = repo.getDurationInfo(1).getNumOfFinishedTasks();
        Assert.assertEquals("There should be no finished tasks, yet", 0, numOfFinishedTasks);

        repo.setPerformed(1, 5);

        numOfFinishedTasks = repo.getDurationInfo(1).getNumOfFinishedTasks();
        Assert.assertEquals("There should be 1 finished task now", 1, numOfFinishedTasks);

        repo.setPerformed(1, 5);

        numOfFinishedTasks = repo.getDurationInfo(1).getNumOfFinishedTasks();
        Assert.assertEquals("There should be 2 finished tasks now", 2, numOfFinishedTasks);

        numOfFinishedTasks = repo.getDurationInfo(2).getNumOfFinishedTasks();
        Assert.assertEquals("There should be 0 finished tasks for TaskId 2", 0, numOfFinishedTasks);
    }
{'fraction_non_alphanumeric': 0.0984, 'fraction_numerical': 0.0164, 'mean_word_length': 4.167355371900826, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3837945', 'n_tokens_mistral': 768, 'n_tokens_neox': 710, 'n_words': 164}