westDoor
V2EX  ›  Java

swtich 语句 要怎么才能单元测试完全覆盖??

  •  
  •   westDoor · Mar 5, 2019 · 2506 views
    This topic created in 2658 days ago, the information mentioned may be changed or developed.

    所有的 case 案例都写了,还提示有分支没覆盖到。

    SoloCompany
        1
    SoloCompany  
       Mar 5, 2019
    即使没有 else 分支也需要覆盖啊
    就好比一个 if 语句你不能说只覆盖 true 分支就 100% 吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2776 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 15:18 · PVG 23:18 · LAX 08:18 · JFK 11:18
    ♥ Do have faith in what you're doing.