generated from yandex-praktikum/java-kanban
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Изменение структуры проекта по тестам, добавление тестов для Managers
- Loading branch information
1 parent
06d0867
commit c168d1b
Showing
12 changed files
with
154 additions
and
105 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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package model; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class EpicTest { | ||
|
||
@Test | ||
void epicTest() { | ||
Epic epic1 = new Epic("Эпическая задача - 1", | ||
"Описание эпической задачи - 1"); | ||
Epic epic2 = new Epic("Эпическая задача - 2", | ||
"Описание эпической задачи - 2"); | ||
epic2.setId(epic1.getId()); | ||
|
||
assertEquals(epic1.getId(), epic2.getId(), "Id Эпиков не совпадают."); | ||
assertEquals(epic1, epic2, "Эпики не совпадают."); | ||
} | ||
} | ||
|
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package model; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class SubtaskTest { | ||
|
||
@Test | ||
void epicTest() { | ||
Subtask subtask1 = new Subtask( "Подзадача - 1", | ||
"Описание подзадачи - 1, эпической задачи - 1", 1); | ||
Subtask subtask2 = new Subtask("Подзадача - 2", | ||
"Описание подзадачи - 2, эпической задачи - 1", 1); | ||
subtask2.setId(subtask1.getId()); | ||
|
||
assertEquals(subtask1.getId(), subtask2.getId(), "Id Подзадач не совпадают."); | ||
assertEquals(subtask1, subtask2, "Подзадачи не совпадают."); | ||
} | ||
} | ||
|
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package model; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class TaskTest { | ||
|
||
@Test | ||
void taskTest() { | ||
Task task1 = new Task("Просто задача - 1", "Описание простой задачи - 1"); | ||
Task task2 = new Task("Просто задача - 2", "Описание простой задачи - 1"); | ||
task2.setId(task1.getId()); | ||
|
||
assertEquals(task1.getId(), task2.getId(), "Id Задач не совпадают."); | ||
assertEquals(task1, task2, "Задачи не совпадают."); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package service; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
public class ManagersTest { | ||
|
||
@Test | ||
void TaskManagerGetDefaultTest() { | ||
final TaskManager manager = Managers.getDefault(); | ||
assertNotNull(manager, "Объект TaskManager не создан"); | ||
} | ||
|
||
@Test | ||
void HistoryManagerGetDefaultHistory() { | ||
final HistoryManager inMemoryHistoryManager = Managers.getDefaultHistory(); | ||
assertNotNull(inMemoryHistoryManager, "Объект HistoryManager не создан"); | ||
} | ||
} |
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.