westDoor
V2EX  ›  Java

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

  •  
  •   westDoor · Mar 5, 2019 · 2525 views
    This topic created in 2665 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   ·   2701 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 12:46 · PVG 20:46 · LAX 05:46 · JFK 08:46
    ♥ Do have faith in what you're doing.