最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How can I test private functions in package access members of private types using `aunit`? - Stack Overflow

programmeradmin3浏览0评论

I am writing a library, which provides several public functions to the users.

The function have at least one arguments/ parameters and/ or return value, which is a private type, because the inner working are not relevant to the user and implementation specific.

How can I write (white-box) unit tests with aunit, which allow be to check whether these arguments/ parameters/ return values using this private type are used correctly.

The fallback would be that I use the other functions in the package to test whether they are working together well, but having unit tests for provided functions, whose assertions depend on other functions of the library under test feels wrong.

I have looked into the AUnit Cookbook, but did not find examples for assertions.

发布评论

评论列表(0)

  1. 暂无评论