This commit is contained in:
Вячеслав Иванов 2024-03-27 20:41:07 +04:00
parent 99bfffc099
commit eb62c727ef
2 changed files with 12 additions and 12 deletions

View File

@ -29,8 +29,8 @@ class TypeServiceTests {
typeService.create(new TypeEntity(null, "Пепперони"));
typeService.create(new TypeEntity(null, "Мясная"));
final TypeEntity last = typeService.create(new TypeEntity(null, "Сырная"));
Assertions.assertEquals(6, typeService.getAll().size());
Assertions.assertEquals(last, typeService.get(6L));
Assertions.assertEquals(3, typeService.getAll().size());
Assertions.assertEquals(last, typeService.get(3L));
}
@Test
@ -40,7 +40,7 @@ class TypeServiceTests {
final TypeEntity entity = typeService.get(3L);
final String oldName = entity.getName();
final TypeEntity newEntity = typeService.update(3L, new TypeEntity(1L, test));
Assertions.assertEquals(6, typeService.getAll().size());
Assertions.assertEquals(3, typeService.getAll().size());
Assertions.assertEquals(newEntity, typeService.get(3L));
Assertions.assertEquals(test, newEntity.getName());
Assertions.assertNotEquals(oldName, newEntity.getName());
@ -50,12 +50,12 @@ class TypeServiceTests {
@Order(3)
void deleteTest() {
typeService.delete(3L);
Assertions.assertEquals(5, typeService.getAll().size());
Assertions.assertEquals(2, typeService.getAll().size());
final TypeEntity last = typeService.get(2L);
Assertions.assertEquals(2L, last.getId());
final TypeEntity newEntity = typeService.create(new TypeEntity(null, "Сырная"));
Assertions.assertEquals(6, typeService.getAll().size());
Assertions.assertEquals(7L, newEntity.getId());
Assertions.assertEquals(3, typeService.getAll().size());
Assertions.assertEquals(4L, newEntity.getId());
}
}

View File

@ -29,8 +29,8 @@ class UserServiceTests {
userService.create(new UserEntity(null, "User 1", "test@test", "qwerty"));
userService.create(new UserEntity(null, "User 2", "test1@test1", "12345678"));
final UserEntity last = userService.create(new UserEntity(null, "User 3", "test2@test2", "mrgurgnugrn"));
Assertions.assertEquals(5, userService.getAll().size());
Assertions.assertEquals(last, userService.get(5L));
Assertions.assertEquals(3, userService.getAll().size());
Assertions.assertEquals(last, userService.get(3L));
}
@Test
@ -42,7 +42,7 @@ class UserServiceTests {
final UserEntity entity = userService.get(3L);
final String oldName = entity.getName();
final UserEntity newEntity = userService.update(3L, new UserEntity(1L, test, email, password));
Assertions.assertEquals(5, userService.getAll().size());
Assertions.assertEquals(3, userService.getAll().size());
Assertions.assertEquals(newEntity, userService.get(3L));
Assertions.assertEquals(test, newEntity.getName());
Assertions.assertNotEquals(oldName, newEntity.getName());
@ -52,12 +52,12 @@ class UserServiceTests {
@Order(3)
void deleteTest() {
userService.delete(3L);
Assertions.assertEquals(4, userService.getAll().size());
Assertions.assertEquals(2, userService.getAll().size());
final UserEntity last = userService.get(2L);
Assertions.assertEquals(2L, last.getId());
final UserEntity newEntity = userService.create(new UserEntity(null, "TEST", "ortrigr@rbirirrgi", "rgkrgimrgirg"));
Assertions.assertEquals(5, userService.getAll().size());
Assertions.assertEquals(6L, newEntity.getId());
Assertions.assertEquals(3, userService.getAll().size());
Assertions.assertEquals(4L, newEntity.getId());
}
}