<commit_before>package io.protostuff.runtime;

import org.junit.Test;
import org.mockito.Mockito;

import io.protostuff.Output;
import io.protostuff.Tag;

/**
 * @author <NAME>
 */
public class RuntimeSchemaEnumTagTest
{

    @Test
    public void testWriteNumericEnum() throws Exception
    {
        RuntimeSchema<A> schema = RuntimeSchema.createFrom(A.class);
        A a = new A();
        a.x = TaggedEnum.TEN;
        Output output = Mockito.mock(Output.class);
        schema.writeTo(output, a);
        Mockito.verify(output).writeEnum(1, 10, false);
        Mockito.verifyNoMoreInteractions(output);
    }

    @Test
    public void testWriteStringEnum() throws Exception {
        // TODO: it is not possible to create this test in simple way until we are using RuntimeEnv singleton
    }

    static enum TaggedEnum<commit_msg>#25: @Tag support for protostuff-runtime - ignore not yet implemented test<commit_after>package io.protostuff.runtime;

import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mockito;

import io.protostuff.Output;
import io.protostuff.Tag;

/**
 * @author <NAME>
 */
public class RuntimeSchemaEnumTagTest
{

    @Test
    public void testWriteNumericEnum() throws Exception
    {
        RuntimeSchema<A> schema = RuntimeSchema.createFrom(A.class);
        A a = new A();
        a.x = TaggedEnum.TEN;
        Output output = Mockito.mock(Output.class);
        schema.writeTo(output, a);
        Mockito.verify(output).writeEnum(1, 10, false);
        Mockito.verifyNoMoreInteractions(output);
    }

    @Test
    @Ignore("https://github.com/protostuff/protostuff/issues/69")
    public void testWriteStringEnum() throws Exception {
        // TODO: it is not possible to create this test in simple way until we are using RuntimeEnv singleton
    }

    static enum TaggedEnum
{'fraction_non_alphanumeric': 0.10010940919037199, 'fraction_numerical': 0.005470459518599562, 'mean_word_length': 3.147392290249433, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, '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': '5047644', 'n_tokens_mistral': 555, 'n_tokens_neox': 540, 'n_words': 143}