Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IgnoreDefaultArgsConstructorCustomisation with enums #17

Open
waliahimanshu opened this issue Mar 29, 2021 · 0 comments
Open

IgnoreDefaultArgsConstructorCustomisation with enums #17

waliahimanshu opened this issue Mar 29, 2021 · 0 comments

Comments

@waliahimanshu
Copy link

waliahimanshu commented Mar 29, 2021

IgnoreDefaultArgsConstructorCustomisation customisation works great for classes with default values.

However, we encountered a case, when class has an enum type and we use IgnoreDefaultArgsConstructorCustomisation fixture creation fails with java.util.NoSuchElementException: List is empty..

Is there a way around this? Thanks.

Example

data class MyClass(val id: String = " ", val value: Int = 1, val type: Type = Type.NORMAL)

enum class Type {
    NORMAL,
    ADVANCED
}
 private val fixture = KFixture().apply {
        add(IgnoreDefaultArgsConstructorCustomisation())
    }
    
    @Test
    fun test() {
        val fixture = fixture<MyClass>() // fails at `MostParameterConstructorQuery ` class
    }

FYI @TWiStErRob ☝🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant