<commit_before>package edu.stanford.bmir.styledstring.attributes;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.startsWith;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;

/**
 * <NAME>
 * Stanford Center for Biomedical Informatics Research
 * 07/12/14
 */
@RunWith(MockitoJUnitRunner.class)
public class StrikeThroughAttribute_TestCase {


    private StrikeThroughAttribute strikeThroughAttribute;

    private StrikeThroughAttribute otherStrikeThroughAttribute;
    private StrikeThrough strikeThrough;


    @Before
    public void setUp() throws Exception {
        strikeThrough = StrikeThrough.SINGLE;
        strikeThroughAttribute = new StrikeThroughAttribute(strikeThrough);
        otherStrikeThroughAttribute = new StrikeThroughAttribute(strikeThrough);
    }

    @Test(expected = NullPointerException.class)
    public void shouldThrowNullPointerException() {
        new StrikeThroughAttribute(null);
    }

    @Test
    public void shouldBeEqualToSelf() {
        assertThat(strikeThroughAttribute, is(equalTo(strikeThroughAttribute)));
    }

    @Test
    public void shouldNotBeEqualToNull() {
        assertThat(strikeThroughAttribute, is(not(equalTo(null))));
    }

    @Test
    public void shouldBeEqualToOther() {
        assertThat(strikeThroughAttribute, is(equalTo(otherStrikeThroughAttribute)));
    }

    @Test
    public void shouldHaveSameHashCodeAsOther() {
        assertThat(strikeThroughAttribute.hashCode(), is(otherStrikeThroughAttribute.hashCode()));
    }

    @Test
    public void shouldGenerateToString() {
        assertThat(strikeThroughAttribute.toString(), startsWith("StrikeThroughAttribute"));
    }
}<commit_msg>Added more tests to the test case for StrikeThroughAttribute<commit_after>package edu.stanford.bmir.styledstring.attributes;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;

import javax.swing.text.StyleConstants;
import java.awt.font.TextAttribute;
import java.text.AttributedCharacterIterator;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.startsWith;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;

/**
 * <NAME>
 * Stanford Center for Biomedical Informatics Research
 * 07/12/14
 */
@RunWith(MockitoJUnitRunner.class)
public class StrikeThroughAttribute_TestCase {


    private StrikeThroughAttribute strikeThroughAttribute;

    private StrikeThroughAttribute otherStrikeThroughAttribute;
    private StrikeThrough strikeThrough;


    @Before
    public void setUp() throws Exception {
        strikeThrough = StrikeThrough.SINGLE;
        strikeThroughAttribute = new StrikeThroughAttribute(strikeThrough);
        otherStrikeThroughAttribute = new StrikeThroughAttribute(strikeThrough);
    }

    @Test(expected = NullPointerException.class)
    public void shouldThrowNullPointerException() {
        new StrikeThroughAttribute(null);
    }

    @Test
    public void shouldBeEqualToSelf() {
        assertThat(strikeThroughAttribute, is(equalTo(strikeThroughAttribute)));
    }

    @Test
    public void shouldNotBeEqualToNull() {
        assertThat(strikeThroughAttribute, is(not(equalTo(null))));
    }

    @Test
    public void shouldBeEqualToOther() {
        assertThat(strikeThroughAttribute, is(equalTo(otherStrikeThroughAttribute)));
    }

    @Test
    public void shouldHaveSameHashCodeAsOther() {
        assertThat(strikeThroughAttribute.hashCode(), is(otherStrikeThroughAttribute.hashCode()));
    }

    @Test
    public void shouldGenerateToString() {
        assertThat(strikeThroughAttribute.toString(), startsWith("StrikeThroughAttribute"));
    }

    @Test
    public void shouldReturnCorrectCssPropertyName() {
        assertThat(strikeThroughAttribute.getCssPropertyName(), is("text-decoration"));
    }

    @Test
    public void shouldReturnCorrectCssPropertyValue() {
        assertThat(strikeThroughAttribute.getCssPropertyValue(), is("line-through"));
    }

    @Test
    public void shouldReturnCorrectAttributedStringAttribute() {
        AttributedCharacterIterator.Attribute expected = TextAttribute.STRIKETHROUGH;
        assertThat(strikeThroughAttribute.getAttributedStringAttribute(), is(expected));
    }

    @Test
    public void shouldReturnCorrectAttributedStringValue() {
        assertThat(strikeThroughAttribute.getAttributedStringValue(), is((Object) TextAttribute.STRIKETHROUGH_ON));
    }

    @Test
    public void shouldReturnCorrectStyledDocumentStyleAttribute() {
        assertThat(strikeThroughAttribute.getStyledDocumentStyleAttribute(), is(StyleConstants.StrikeThrough));
    }

    @Test
    public void shouldReturnCorrectStyledDocumentAttributeValue() {
        assertThat(strikeThroughAttribute.getStyledDocumentStyleAttributeValue(), is((Object) true));
    }
}
{'fraction_non_alphanumeric': 0.08636977058029689, 'fraction_numerical': 0.002313475997686524, 'mean_word_length': 4.6147186147186146, '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': '4268948', 'n_tokens_mistral': 1486, 'n_tokens_neox': 1382, 'n_words': 251}