PrepZone Logo
PrepZone
Back to AI Coding

AI Coding · Medium

The assistant wrote this unit test and says coverage is now 100%. Is the code verified?

AI CodingVerificationSenior
java
@Test
void calculatesDiscount() {
    PricingService service = mock(PricingService.class);
    when(service.discount(any())).thenReturn(new BigDecimal("10.00"));

    BigDecimal result = service.discount(new Cart(List.of(item(100))));

    assertEquals(new BigDecimal("10.00"), result);
}