储能电池主动均衡方案:MP2642GR-Z与STM32F423RH硬件设计与软件实现
2026/10/17 5:52:23
and:块拆分when:块在Spock测试中,when:块可以被拆分,通过and:块来实现。以下是一个示例:
def "A basket with three products weights as their sum (alternate)"() { given: "an empty basket, a TV,a camera and a hifi" Basket basket = new Basket() Product tv = new Product(name:"bravia",price:1200,weight:18) Product camera = new Product(name:"panasonic",price:350,weight:2) Product hifi = new Product(name:"jvc",price:600,weight:5) when: "user wants to buy the TV.." basket.addProduct tv and: "..the camera.." basket.addProduct camera and: "..and the wifi"