How do I test if a private method has a field with a name and a type?

How do I test if a private method has a field with a name and a type?

Apr 18 ’20
Comments: 1
Answers: 0
0

Here is the private method I am trying to test

    private int privateMethod(int[] numbers) {
        var sum = 0;
        for (int number : numbers) {
            sum += number;
        }
        return sum;
    }

I am doing this in Java 11

And following is my test using Junit5

import org.junit.jupiter.api.Test;
import org.junit.platform.commons.function.Try;


Open Full Question

原文链接:How do I test if a private method has a field with a name and a type?

© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容