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()); + } +}