<commit_before>package day.seven;

import day.seven.analyzers.Analyzer;
import day.seven.analyzers.Ssl;
import org.junit.Assert;
import org.junit.Test;

import java.io.File;

/**
 * Created by Pawel on 2016-12-07.
 */
public class SslTest {

    private Analyzer classUnderTests = new Ssl();

    @Test
    public void testWhenValidPatternIsBeforeSquareBrackets() throws Exception {
        String path = new File(getClass().getClassLoader().getResource("day.seven/test-input-1-valid-ssl").getFile()).getPath();

        int analyze = classUnderTests.analyze(path);
        Assert.assertEquals(1,analyze);
    }

    @Test
    public void testWhenValueIsOutsideSquareBracketsWithinLargerString() throws Exception {
        String path = new File(getClass().getClassLoader().getResource("day.seven/test-input-2-valid-ssl").getFile()).getPath();

        int analyze = classUnderTests.analyze(path);
        Assert.assertEquals(1,analyze);
    }

    @Test
    public void testWhenValueIsWithinSquareBrackets() throws Exception {
        String path = new File(getClass().getClassLoader().getResource("day.seven/test-input-3-valid-ssl").getFile()).getPath();

        int analyze = classUnderTests.analyze(path);
        Assert.assertEquals(1,analyze);
    }

    @Test
    public void testWhenValueNotFound() throws Exception {
        String path = new File(getClass().getClassLoader().getResource("day.seven/test-input-4-invalid-ssl").getFile()).getPath();

        int analyze = classUnderTests.analyze(path);
        Assert.assertEquals(0,analyze);
    }
}
<commit_msg>advent of code, scenario 7<commit_after>package day.seven;

import day.seven.analyzers.Analyzer;
import day.seven.analyzers.Ssl;
import org.junit.Assert;
import org.junit.Test;

import java.io.File;

/**
 * Created by Pawel on 2016-12-07.
 */
public class SslTest {

    private Analyzer classUnderTests = new Ssl();

    @Test
    public void testOutsideSquareBracketsWithCorrespondingBabWithinSquareBrackets() throws Exception {
        String path = new File(getClass().getClassLoader().getResource("day.seven/test-input-1-valid-ssl").getFile()).getPath();

        int analyze = classUnderTests.analyze(path);
        Assert.assertEquals(1,analyze);
    }

    @Test
    public void testWithinLongStringCorrectValueAndInsideSquareBrackets() throws Exception {
        String path = new File(getClass().getClassLoader().getResource("day.seven/test-input-2-valid-ssl").getFile()).getPath();

        int analyze = classUnderTests.analyze(path);
        Assert.assertEquals(1,analyze);
    }

    @Test
    public void testEkeInSupernetWithCorrespondingKekInHypernet() throws Exception {
        String path = new File(getClass().getClassLoader().getResource("day.seven/test-input-3-valid-ssl").getFile()).getPath();

        int analyze = classUnderTests.analyze(path);
        Assert.assertEquals(1,analyze);
    }

    @Test
    public void testNoCorrespondingValueInSquareAndAfterSquareBrackets() throws Exception {
        String path = new File(getClass().getClassLoader().getResource("day.seven/test-input-4-invalid-ssl").getFile()).getPath();

        int analyze = classUnderTests.analyze(path);
        Assert.assertEquals(0,analyze);
    }
}

{'fraction_non_alphanumeric': 0.12492250464972102, 'fraction_numerical': 0.01022938623682579, 'mean_word_length': 3.83808095952024, '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': '7656634', 'n_tokens_mistral': 974, 'n_tokens_neox': 935, 'n_words': 166}