Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions src/main/java/com/booleanuk/core/TodoItem.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.booleanuk.core;

public class TodoItem {
public String title;
public String detail;
public String status;
private String title;
private String detail;
private String status;

public TodoItem(String title, String detail, String status) {
this.title = title;
this.detail = detail;
this.status = status;

}

public void setStatus(String status) {
Expand All @@ -18,4 +19,20 @@ public void setStatus(String status) {
public String getStatus() {
return this.status;
}

public void setDetail(String detail) {
this.detail = detail;
}

public String getDetail() {
return this.detail;
}

public void setTitle(String title) {
this.title = title;
}

public String getTitle() {
return this.title;
}
}
47 changes: 47 additions & 0 deletions src/test/java/com/booleanuk/core/TodoItemTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,51 @@

class TodoItemTest {

@Test
public void setStatusOnItem(){
TodoItem todoItem = new TodoItem("Clean", "vacuum the apartment", "Not done");

todoItem.setStatus("Done");

Assertions.assertSame("Done", todoItem.getStatus());
}

@Test
public void getStatusOnItem(){
TodoItem todoItem = new TodoItem("Clean", "vacuum the apartment", "Not done");

Assertions.assertSame("Not done", todoItem.getStatus());
}

@Test
public void setTitleOnItem(){
TodoItem todoItem = new TodoItem("Clean", "vacuum the apartment", "Not done");

todoItem.setTitle("Wash");

Assertions.assertSame("Wash", todoItem.getTitle());
}

@Test
public void getTitleOnItem(){
TodoItem todoItem = new TodoItem("Run", "vacuum the apartment", "Not done");

Assertions.assertSame("Run", todoItem.getTitle());
}

@Test
public void setDetailOnItem(){
TodoItem todoItem = new TodoItem("Clean", "vacuum the apartment", "Not done");

todoItem.setDetail("Clean the kitchen");

Assertions.assertSame("Clean the kitchen", todoItem.getDetail());
}

@Test
public void getDetailOnItem(){
TodoItem todoItem = new TodoItem("Clean", "clean the floors", "Not done");

Assertions.assertSame("clean the floors", todoItem.getDetail());
}
}
Loading