Skip to content

测试状态 V.S. 测试调用 | Hexo #2

@coderfengyun

Description

@coderfengyun

https://coderfengyun.github.io/2021/06/15/test-series.testing-state-vs-testing-interactions/

单元测试主要有两种方式来验证待验证代码是否正常工作:通过测试状态和通过测试调用。二者有什么分别呢? 测试状态意味着只去验证待测代码返回的结果是否正确12345678public void testSortNumbers() { NumberSorter numberSorter = new NumberSorter(quicksort, bubbleSort); // Verify

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions