From 249ee6fe65b7a068fbb1195b6f0bb316709a701e Mon Sep 17 00:00:00 2001 From: Bruno Date: Thu, 10 Nov 2022 16:46:25 +0100 Subject: [PATCH] Test 3 --- test/MainTest.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/MainTest.java diff --git a/test/MainTest.java b/test/MainTest.java new file mode 100644 index 0000000..8d96ecc --- /dev/null +++ b/test/MainTest.java @@ -0,0 +1,22 @@ +import org.junit.jupiter.api.Test; + +import java.io.ByteArrayInputStream; + +import static org.junit.jupiter.api.Assertions.*; + +class MainTest { + + @Test + public void testFirstTryRight() { + + //Arrange + byte[] bytes = "hofmannol\nGeronimo\n".getBytes(); + ByteArrayInputStream in = new ByteArrayInputStream(bytes); + + //Act + boolean logged_in = Main.login(in); + + assertTrue(logged_in); + } + +} \ No newline at end of file