From 9d200788d07146acff3c13d663f1ba0e59439fad Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 27 Sep 2022 12:57:16 +0200 Subject: [PATCH] Add tests for the `LCMServer` --- .../java/ch/nuth/zhaw/exbox/ADS1_1_test.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/src/test/java/ch/nuth/zhaw/exbox/ADS1_1_test.java diff --git a/app/src/test/java/ch/nuth/zhaw/exbox/ADS1_1_test.java b/app/src/test/java/ch/nuth/zhaw/exbox/ADS1_1_test.java new file mode 100644 index 0000000..100fbb1 --- /dev/null +++ b/app/src/test/java/ch/nuth/zhaw/exbox/ADS1_1_test.java @@ -0,0 +1,23 @@ +package ch.nuth.zhaw.exbox; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class ADS1_1_test { + LCMServer server; + + @BeforeEach + public void setUp() { + server = new LCMServer(); + } + + @Test + public void testKgv() { + assertEquals(12, server.leastCommonMultiple(3, 4), "kgv von 3 4"); + assertEquals(4, server.leastCommonMultiple(2, 4), "kgv von 2 4"); + assertEquals(35, server.leastCommonMultiple(5, 7), "kgv von 5 7"); + assertEquals(12, server.leastCommonMultiple(4, 6), "kgv von 4 6"); + } +}