package tests;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import backend.resource.TurboLabel;
import backend.resource.serialization.SerializableLabel;

public class SerializationTests {

    @Test
    public void testSerializableLabelNoColorColorToString() {
        TurboLabel label = new TurboLabel("dummy/dummy", "label.name");
        SerializableLabel serializedLabel = new SerializableLabel(label);

        assertEquals(serializedLabel.toString(), "Label: {name: label.name, color: ffffff}");
    }

    @Test
    public void testSerializableLabelWithColorToString() {
        TurboLabel label = new TurboLabel("dummy/dummy", "abcdef", "label.name");
        SerializableLabel serializedLabel = new SerializableLabel(label);

        assertEquals(serializedLabel.toString(), "Label: {name: label.name, color: abcdef}");
    }
}

@@ -66,116 +66,320 @@
 ort 
-org.junit.Test;%0A%0Aimport backend.resource.TurboLabel;%0Aimport backend.resource.serialization.SerializableLabel
+java.time.LocalDate;%0Aimport java.util.Optional;%0A%0Aimport org.eclipse.egit.github.core.Milestone;%0Aimport org.junit.Test;%0A%0Aimport backend.resource.TurboLabel;%0Aimport backend.resource.TurboMilestone;%0Aimport backend.resource.serialization.SerializableLabel;%0Aimport backend.resource.serialization.SerializableMilestone
 ;%0A%0Ap
@@ -1057,11 +1057,2226 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testSerializableMilestoneNoDueDateToString() %7B%0A        Milestone milestone = new Milestone();%0A        milestone.setNumber(1);%0A        milestone.setTitle(%22test milestone%22);%0A        milestone.setState(%22open%22);%0A%0A        TurboMilestone turboMilestone = new TurboMilestone(%22dummy/dummy%22, milestone);%0A        turboMilestone.setDueDate(Optional.%3CLocalDate%3Eempty());%0A        turboMilestone.setDescription(%22test description%22);%0A        turboMilestone.setOpen(false);%0A        turboMilestone.setOpenIssues(0);%0A        turboMilestone.setClosedIssues(0);%0A%0A        SerializableMilestone serializedMilestone = new SerializableMilestone(turboMilestone);%0A%0A        String formatter = %22Milestone: %7B%25n%22%0A                + %22  id: 1%25n%22%0A                + %22  title: test milestone%25n%22%0A                + %22  dueDate: %25n%22%0A                + %22  description: test description%25n%22%0A                + %22  isOpen: false%25n%22%0A                + %22  openIssues: 0%25n%22%0A                + %22  closedIssues: 0%25n%22%0A                + %22%7D%22;%0A%0A        assertEquals(serializedMilestone.toString(), String.format(formatter));%0A    %7D%0A%0A    @Test%0A    public void testSerializableMilestoneWithDueDateToString() %7B%0A        Milestone milestone = new Milestone();%0A        milestone.setNumber(1);%0A        milestone.setTitle(%22test milestone%22);%0A        milestone.setState(%22open%22);%0A%0A        TurboMilestone turboMilestone = new TurboMilestone(%22dummy/dummy%22, milestone);%0A        turboMilestone.setDueDate(Optional.of(LocalDate.of(1, 1, 1)));%0A        turboMilestone.setDescription(%22test description%22);%0A        turboMilestone.setOpen(true);%0A        turboMilestone.setOpenIssues(0);%0A        turboMilestone.setClosedIssues(0);%0A%0A        SerializableMilestone serializedMilestone = new SerializableMilestone(turboMilestone);%0A%0A        String formatter = %22Milestone: %7B%25n%22%0A                + %22  id: 1%25n%22%0A                + %22  title: test milestone%25n%22%0A                + %22  dueDate: 0001-01-01%25n%22%0A                + %22  description: test description%25n%22%0A                + %22  isOpen: true%25n%22%0A                + %22  openIssues: 0%25n%22%0A                + %22  closedIssues: 0%25n%22%0A                + %22%7D%22;%0A%0A        assertEquals(serializedMilestone.toString(), String.format(formatter));%0A    %7D
 %0A%7D%0A

Add tests for SerializableMilestone's toString