<commit_before>/*
package com.spectralogic.ds3autogen.c;

import com.spectralogic.ds3autogen.c.models.Element;
import org.junit.Test;

import java.text.ParseException;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

public class Type_Test {
    @Test
    public void testElementTypeArrayToString() throws ParseException {
        Element stringElement = new Element("arrayElement", "array", null, null);
        assertThat(CHelper.elementTypeToString(stringElement), is(""));
    }
    @Test
    public void testElementTypeSetToString() throws ParseException {
        Element stringElement = new Element("setElement", "java.util.Set", null, null);
        assertThat(CHelper.elementTypeToString(stringElement), is(""));
    }
}
*/<commit_msg>Add a few tests for ds3_autogen_c::Type<commit_after>package com.spectralogic.ds3autogen.c;

import com.google.common.collect.ImmutableList;
import com.spectralogic.ds3autogen.api.models.Ds3Element;
import com.spectralogic.ds3autogen.c.models.Type;
import org.junit.Test;

import java.text.ParseException;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

public class Type_Test {
    @Test
    public void testTypeIsPrimitive() throws ParseException {
        Ds3Element testElement1 = new Ds3Element("intElement", "int", null, null);
        Ds3Element testElement2 = new Ds3Element("boolElement", "boolean", null, null);
        final ImmutableList.Builder<Ds3Element> builder = ImmutableList.builder();
        builder.add(testElement1);
        builder.add(testElement2);
        Type testType = new Type("testType", null, builder.build());
        assertThat(testType.isPrimitiveType(), is(true));
    }
    @Test
    public void testTypeIsNotPrimitive() throws ParseException {
        Ds3Element testElement1 = new Ds3Element("boolElement", "boolean", null, null);
        Ds3Element testElement2 = new Ds3Element("complexElement", "com.spectralogic.s3.server.domain.UserApiBean", null, null);
        final ImmutableList.Builder<Ds3Element> builder = ImmutableList.builder();
        builder.add(testElement1);
        builder.add(testElement2);
        Type testType = new Type("testType", null, builder.build());
        assertThat(testType.isPrimitiveType(), is(false));
    }
    /*
    @Test
    public void testElementTypeArrayToString() throws ParseException {
        Element stringElement = new Element("arrayElement", "array", null, null);
        assertThat(CHelper.elementTypeToString(stringElement), is(""));
    }
    @Test
    public void testElementTypeSetToString() throws ParseException {
        Element stringElement = new Element("setElement", "java.util.Set", null, null);
        assertThat(CHelper.elementTypeToString(stringElement), is(""));
    }
    */
}
{'fraction_non_alphanumeric': 0.11366043063889869, 'fraction_numerical': 0.009177550300035298, 'mean_word_length': 4.2481481481481485, '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': '2278366', 'n_tokens_mistral': 818, 'n_tokens_neox': 820, 'n_words': 172}