westDoor
V2EX  ›  Java

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

  •  
  •   westDoor · Mar 5, 2019 · 2494 views
    This topic created in 2653 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   ·   1640 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 16:39 · PVG 00:39 · LAX 09:39 · JFK 12:39
    ♥ Do have faith in what you're doing.