<commit_before>@file:Suppress("IllegalIdentifier")

package activitystarter.wrapper

import activitystarter.ActivityStarter
import activitystarter.assertSubtype
import android.os.Parcelable
import org.junit.After
import org.junit.Test

class WrapperManagerBuildTest {

    class DateTime
    internal class ParcelableWrapper : ArgWrapper<Any, Parcelable>
    internal class DateTimeWrapper : ArgWrapper<DateTime, Long>

    @After fun tearDown() {
        ActivityStarter.setWrapperManager(null)
    }

    @Test fun `ArgWrappers can be defined using Builder`() {
        ActivityStarter.setWrapperManager(WrapperManager.Builder().build())
    }

    @Test fun `ArgWrappers can be created by builder with multiple ArgWrappers`() {
        val wrapperManager = getBasicWrapperManager()
        ActivityStarter.setWrapperManager(wrapperManager)
    }

    @Test fun `WrapperManager is mappig base classes as defined`() {
        val wrapperManager = getBasicWrapperManager()
        assertSubtype(Long::class.javaObjectType, wrapperManager.mappingType(DateTime::class.java))
        assertSubtype(Parcelable::class.java, wrapperManager.mappingType(Any::class.java))
    }

    @Test fun `WrapperManager is mappig super classes as defined`() {

    }

        private fun getBasicWrapperManager(): WrapperManager = WrapperManager
            .Builder()<commit_msg>WrapperManager is mappig super classes as defined.<commit_after>@file:Suppress("IllegalIdentifier")

package activitystarter.wrapper

import activitystarter.ActivityStarter
import activitystarter.assertSubtype
import android.os.Parcelable
import org.junit.After
import org.junit.Test

class WrapperManagerBuildTest {

    open class DateTime
    internal class ParcelableWrapper : ArgWrapper<Any, Parcelable>
    internal class DateTimeWrapper : ArgWrapper<DateTime, Long>

    internal class ExampleDateTime : DateTime()
    internal class ExampleClass

    @After fun tearDown() {
        ActivityStarter.setWrapperManager(null)
    }

    @Test fun `ArgWrappers can be defined using Builder`() {
        ActivityStarter.setWrapperManager(WrapperManager.Builder().build())
    }

    @Test fun `ArgWrappers can be created by builder with multiple ArgWrappers`() {
        val wrapperManager = getBasicWrapperManager()
        ActivityStarter.setWrapperManager(wrapperManager)
    }

    @Test fun `WrapperManager is mappig base classes as defined`() {
        val wrapperManager = getBasicWrapperManager()
        assertSubtype(Long::class.javaObjectType, wrapperManager.mappingType(DateTime::class.java))
        assertSubtype(Parcelable::class.java, wrapperManager.mappingType(Any::class.java))
    }

    @Test fun `WrapperManager is mappig super classes as defined`() {
        val wrapperManager = getBasicWrapperManager()
        assertSubtype(Long::class.javaObjectType, wrapperManager.mappingType(ExampleDateTime::class.java))
        assertSubtype(Parcelable::class.java, wrapperManager.mappingType(ExampleClass::class.java))
    }

    private fun getBasicWrapperManager(): WrapperManager = WrapperManager
            .Builder()
{'fraction_non_alphanumeric': 0.08223153821347952, 'fraction_numerical': 0.0, 'mean_word_length': 4.339070567986231, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4673254', 'n_tokens_mistral': 805, 'n_tokens_neox': 792, 'n_words': 192}