Skip to content

Commit

Permalink
Making test date distinct
Browse files Browse the repository at this point in the history
  • Loading branch information
rossdrew committed Apr 12, 2024
1 parent 53085d2 commit 994ef4e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/test/java/com/rox/journal/entry/JournalEntryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.junit.jupiter.api.Assertions.*;

public class JournalEntryTest {
final Date testDate = new Date();
final Date testDate = new GregorianCalendar(2015, Calendar.OCTOBER, 21).getTime();

@BeforeAll
public static void setup(){
Expand Down Expand Up @@ -55,8 +57,8 @@ public void testEquality(){

@Test
public void testInequality(){
final JournalEntry entryA = JournalEntry.create("This is a test").at(testDate);
final JournalEntry differentContentEntry = JournalEntry.create("This is not the same").at(testDate);
final JournalEntry entryA = JournalEntry.create("Marty Arrives in 2015").at(testDate);
final JournalEntry differentContentEntry = JournalEntry.create("Jaws 19 Released").at(testDate);
final JournalEntry differentDateEntry = JournalEntry.create("This is a test").at(new Date());
final JournalEntry differentContentAndDateEntry = JournalEntry.create("This is not the same").at(new Date());

Expand Down

0 comments on commit 994ef4e

Please sign in to comment.