如何为“ this” keywrd和以下方法编写junit。我只知道基础知识并坚持使用

时间:2019-04-01 13:05:32

标签: java junit

由于对junit陌生,因此发现此类方法令人困惑。任何提示或解决方案将不胜感激。 我能够为一些数学运算编写测试用例,但无法为此类方法编写。

public class ErrorThreshold {
    private String attributeType = null;
    private String errorCode = null;

    public ErrorThreshold()
    {

    }

    public ErrorThreshold(String attributeType,  String errorCode)
    {
        this.attributeType = attributeType;
        this.errorCode = errorCode;
    }

    public String getAttributeType() {
        return attributeType;
    }

    public void setAttributeType(String attributeType) {
        this.attributeType = attributeType;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }
}

0 个答案:

没有答案