-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Реализован метод deleteSubtaskById и исправлены ошибки
- Loading branch information
Showing
9 changed files
with
146 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,37 @@ | ||
package tasktracker.manager; | ||
|
||
|
||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import tasktracker.manager.InMemoryTaskManager; | ||
import tasktracker.manager.TaskManager; | ||
import tasktracker.model.Task; | ||
|
||
import tasktracker.model.TaskStatus; | ||
|
||
|
||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
public class InMemoryTaskManagerTest { | ||
|
||
|
||
|
||
private TaskManager taskManager; | ||
|
||
|
||
|
||
@BeforeEach | ||
|
||
public void setUp() { | ||
|
||
taskManager = new InMemoryTaskManager(); | ||
|
||
} | ||
|
||
|
||
|
||
@Test | ||
|
||
public void addTaskTest() { | ||
|
||
Task task = new Task("Test Task", "Test Description", taskManager.generateId(), TaskStatus.NEW); | ||
|
||
taskManager.createTask(task); | ||
|
||
|
||
|
||
assertEquals(1, taskManager.getAllTasks().size()); | ||
|
||
assertEquals(task, taskManager.getAllTasks().getFirst()); | ||
|
||
} | ||
|
||
|
||
|
||
@Test | ||
|
||
public void getHistoryTest() { | ||
|
||
Task task = new Task("Test Task", "Test Description", taskManager.generateId(), TaskStatus.NEW); | ||
|
||
taskManager.createTask(task); | ||
|
||
// Получаем задачу, чтобы добавить её в историю | ||
taskManager.getTask(task.getId()); | ||
|
||
|
||
|
||
// Проверяем, что история содержит 1 задачу | ||
assertEquals(1, taskManager.getHistory().size()); | ||
|
||
assertEquals(task, taskManager.getHistory().getFirst()); | ||
|
||
} | ||
|
||
} | ||
@Test | ||
public void testInitialization() { | ||
assertNotNull(taskManager); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.