From 0d1987ce386ca7788076a94710fd4fc5c032c717 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Wed, 28 Oct 2020 17:35:18 +0100 Subject: [PATCH] Commitment unit tests --- src/test/java/Main/CommitmentTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/test/java/Main/CommitmentTest.java diff --git a/src/test/java/Main/CommitmentTest.java b/src/test/java/Main/CommitmentTest.java new file mode 100644 index 0000000..7434fd8 --- /dev/null +++ b/src/test/java/Main/CommitmentTest.java @@ -0,0 +1,16 @@ +package Main; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + +public class CommitmentTest { + + @Test + public void CommitmentHashingTest(){ + Commitment alice = new Commitment("Test"); + Commitment bob = new Commitment(alice.getSequenceA(), alice.getHash()); + bob.setSequenceB(alice.getSequenceB()); + bob.setMessage(alice.getMessage()); + assertTrue(bob.checkHash()); + } +}