CalculatorTest implementation

Report a typo

Let's say we have a Calculator class, which performs simple arithmetic operations. We want to write tests for this class using the MockK framework to check that the class is working correctly.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                val calculator = mockk<Calculator>()
              
                }
              
                fun testAddition() {
              
                }
              
                class CalculatorTest {
              
                every { calculator.add(2, 3) } returns 5
              
                @Test
              
                assertEquals(5, calculator.add(2, 3))
              
___

Create a free account to access the full topic