1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-25 18:15:49 +01:00

Some basics for testing the calendar functionality

This commit is contained in:
cpfeiffer 2017-04-24 11:57:34 +02:00
parent d570d188a2
commit 523055189f
2 changed files with 24 additions and 1 deletions

View File

@ -93,7 +93,7 @@ public class CalendarEvents {
}
}
public class CalendarEvent {
public static class CalendarEvent {
private long begin;
private long end;
private long id;

View File

@ -0,0 +1,23 @@
package nodomain.freeyourgadget.gadgetbridge.test;
import org.junit.Test;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEvents;
import static org.junit.Assert.assertNotEquals;
public class CalendarEventTest extends TestBase {
private static final long BEGIN = 1;
private static final long END = 2;
private static final long ID_1 = 100;
@Test
public void testHashCode() {
CalendarEvents.CalendarEvent c1 = new CalendarEvents.CalendarEvent(BEGIN, END, ID_1, "something", null, null, null, false);
CalendarEvents.CalendarEvent c2 = new CalendarEvents.CalendarEvent(BEGIN, END, ID_1, "something", null, null, null, false);
CalendarEvents.CalendarEvent c3 = new CalendarEvents.CalendarEvent(BEGIN, END, ID_1, "something", null, null, null, false);
assertNotEquals(c1.hashCode(), c2.hashCode());
assertNotEquals(c2.hashCode(), c3.hashCode());
}
}