Skip to content

Commit

Permalink
Syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
RealityAdmin committed Dec 6, 2022
2 parents a33831e + e4b52f7 commit f2cf534
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
17 changes: 14 additions & 3 deletions event/EventTest.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
package event;

import org.junit.jupiter.api.Test;
import timeBehaviour.TimePoint;

import java.time.LocalDateTime;

import static org.junit.jupiter.api.Assertions.assertEquals;


/**
* A Unit Test Class for Event.java.
*/
class EventTest {
class EventTest
{
/**
* A Unit Test for Event.complete().
*/
@Test
void complete() {
void completeTest()
{
Event e = new Event("Event1", "testing", 100, new TimePoint(LocalDateTime.now()));

e.complete();

assertEquals(0, Event.getObserverList().size());
}
}
}
21 changes: 14 additions & 7 deletions model/CalendarModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,51 @@
import java.io.Serializable;
import java.util.ArrayList;


// Class to store app information behind the scene
public class CalendarModel implements Serializable {

// list of events
ArrayList<Event> events;

// color settings
public String colour;
public String colour_font;

// list of goals that remain the same
private static ArrayList<EventObserver> completedGoals = new ArrayList<>();


// Constructor for no events
public CalendarModel()
{
this.events = new ArrayList<Event>();
}


// Constructor if some events are there
public CalendarModel(ArrayList<Event> events){
this.events = events;
}


// get list of completed goals
public static ArrayList<EventObserver> getCompletedGoals() {
return completedGoals;
}


// set completed goals
public static void setCompletedGoals(ArrayList<EventObserver> oList) {completedGoals = oList;}


// add an event to the calendar
public void addEvent(Event e)
{
this.events.add(e);
}


// get the list of all events
public ArrayList<Event> getAllEvents(){
return this.events;
}


// get events filtered by a date
public ArrayList<Event> getEventsInTime(LocalDateTime time)
{
ArrayList<Event> filteredEvents = new ArrayList<>();
Expand Down
3 changes: 3 additions & 0 deletions out/production/The-Hamburglars/The-Hamburglars.iml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<SOURCES />
</library>
</orderEntry>
<<<<<<< HEAD
<orderEntry type="module-library">
<library name="JUnit5.8.1">
<CLASSES>
Expand All @@ -56,5 +57,7 @@
<SOURCES />
</library>
</orderEntry>
=======
>>>>>>> e4b52f77b1e1669b3b2bf81452780ef1c69c30fe
</component>
</module>

0 comments on commit f2cf534

Please sign in to comment.