Last active
July 6, 2024 15:25
-
-
Save birojow/73ff9e2c573c04faaeadfa6c063a8e43 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CalculatorScreenTest { | |
@get:Rule | |
val composeRule = createAndroidComposeRule(MainActivity::class.java) | |
private val robot = CalculatorScreenRobot(composeRule) | |
private fun arrange(block: CalculatorScreenRobot.Arrange.() -> Unit) = | |
robot.Arrange().apply(block) | |
private fun act(block: CalculatorScreenRobot.Act.() -> Unit) = | |
robot.Act().apply(block) | |
private fun assert(block: CalculatorScreenRobot.Assert.() -> Unit) = | |
robot.Assert().apply(block) | |
@Test | |
fun shouldCalculateExpressionsCorrectly() { | |
// arrange | |
enterFormula("((515 + 87 x 311) - 302) ÷ 27") | |
// act | |
performCalculation() | |
// assert | |
assertResultIs("1010.0") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment