From cf711967bf175139c89bbf0f2faeba8ed67bbb55 Mon Sep 17 00:00:00 2001 From: Mihir Panjikar Date: Sat, 2 Mar 2024 12:08:51 +0530 Subject: [PATCH] Added isaExamTests which includes tests for function isEven of class Exam --- .../lab3/BCA2205126/isaExamTests.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lab3/src/test/java/mes/casetools/lab3/BCA2205126/isaExamTests.java diff --git a/lab3/src/test/java/mes/casetools/lab3/BCA2205126/isaExamTests.java b/lab3/src/test/java/mes/casetools/lab3/BCA2205126/isaExamTests.java new file mode 100644 index 0000000..2640e28 --- /dev/null +++ b/lab3/src/test/java/mes/casetools/lab3/BCA2205126/isaExamTests.java @@ -0,0 +1,27 @@ +package mes.casetools.lab3.BCA2205126; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +import mes.casetools.lab3.Exam.Exam; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + + +@SpringBootTest +public class isaExamTests { + Exam examtest = new Exam(); + @Test + void assertEven(){ + + boolean true_result = examtest.isEven(6); + assertTrue(true_result, "The condition should be true"); + } + + @Test + void assertOdd(){ + boolean false_result = examtest.isEven(5); + assertFalse(false_result, "The condition should be false"); + } +}