Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.project.myapplication
- import org.junit.jupiter.api.Assertions.assertEquals
- import org.spekframework.spek2.Spek
- import org.spekframework.spek2.style.gherkin.Feature
- object MathTest : Spek({
- Feature("math") {
- val math = Math()
- Scenario("do multiplication") {
- var a = 0
- var b = 0
- var multiple = 0
- val result = 21
- Given("initial a and b") {
- a = 3
- b = 7
- }
- When("multiple a with b") {
- multiple = math.multiplication(a, b)
- }
- Then("it should return multiplication between a and b") {
- assertEquals(result, multiple)
- }
- }
- Scenario("do division") {
- var a = 0
- var b = 0
- var division = 0
- val result = 3
- Given("initial a and b") {
- a = 21
- b = 7
- }
- When("division a with b") {
- division = math.division(a, b)
- }
- Then("it should return division between a and b") {
- assertEquals(result, division)
- }
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement