From 2ddb775b3a61c8f3765d38916dadeb5ab556d744 Mon Sep 17 00:00:00 2001 From: fdai7446 <––fdai7446@fhfddvz1.rz.hs-fulda.de> Date: Fri, 10 Feb 2023 21:29:16 +0100 Subject: [PATCH] testRandomIntegerNummer --- TaschenrechnerTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TaschenrechnerTest.java b/TaschenrechnerTest.java index 8ef5acc..7c3a42d 100644 --- a/TaschenrechnerTest.java +++ b/TaschenrechnerTest.java @@ -78,7 +78,12 @@ public class TaschenrechnerTest { @Test public void testRandomIntegerNummer() { + int a = 2; + int b = 10; + int r = (int) (Math.random() * (a + 1)) + b; + boolean result = r > a && r >= b; + assertEquals(true, result); } }