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

Readme의 setExp 관련 질문 #1094

Open
Danden1 opened this issue Nov 18, 2024 · 1 comment
Open

Readme의 setExp 관련 질문 #1094

Danden1 opened this issue Nov 18, 2024 · 1 comment
Labels
question Further information is requested

Comments

@Danden1
Copy link

Danden1 commented Nov 18, 2024

Describe your question

안녕하세요.

fixture monkey 를 만들어주셔서 감사합니다.

README에서 kotlin 예제를 보면, setExp를 이용해서 property에 값을 주고 있습니다.

data class Order (
    val id: Long,

    val orderNo: String,

    val productName: String,

    val quantity: Int,

    val price: Long,

    val items: List<String>,

    val orderedAt: Instant
)

@Test
fun sampleOrder() {
    // given
    val sut = FixtureMonkey.builder()
            .plugin(KotlinPlugin())
            .build()

    // when
    val actual = sut.giveMeBuilder<Order>()
            .setExp(Order::orderNo, "1") //deprecated?
            .setExp(Order::productName, "Line Sally")
            .minSizeExp(Order::items, 1)
            .sample()

    // then
    then(actual.orderNo).isEqualTo("1")
    then(actual.productName).isEqualTo("Line Sally")
    then(actual.items).hasSizeGreaterThanOrEqualTo(1)
}

setExp를 사용하려고 코드를 작성하니 deprecated 된 것 같습니다.
혹시 README가 업데이트가 안된 걸까요?

만약 그렇다면, 어떤 함수를 이용해서 property를 업데이트 해줄 수 있을까요?

감사합니다.

@Danden1 Danden1 added the question Further information is requested label Nov 18, 2024
@seongahjo
Copy link
Contributor

@Danden1 님 안녕하세요.

deprecate된 건 setExp 확장함수입니다.
대신 sut.giveMeKotlinBuilder<Order>()setExp를 사용하시는 걸 권장드립니다.

문서는 업데이트 해놓겠습니다, 감사합니다!

감사합니다.

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

No branches or pull requests

2 participants