| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /*
- * Copyright (c) Andrew Grant of Carrick Software 30/03/2025, 13:45. All rights reserved.
- *
- */
- package scot.carricksoftware.grants.converters.text.persontext;
- import org.junit.jupiter.api.BeforeEach;
- import org.junit.jupiter.api.Test;
- import scot.carricksoftware.grants.commands.text.PersonTextCommand;
- import scot.carricksoftware.grants.commands.text.PersonTextCommandImpl;
- import scot.carricksoftware.grants.domains.people.Person;
- import scot.carricksoftware.grants.domains.text.PersonText;
- import static org.junit.jupiter.api.Assertions.assertEquals;
- import static org.junit.jupiter.api.Assertions.assertNotNull;
- import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
- import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
- import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
- class PersonTextCommandConverterTest {
- private PersonTextCommandConverter converter;
- @BeforeEach
- void setUp() {
- converter = new PersonTextCommandConverterImpl();
- }
- @Test
- void covertTest() {
- Long Id = GetRandomLong();
- Person person = GetRandomPerson();
- Long order = GetRandomLong();
- Long level = GetRandomLong();
- String heading = GetRandomString();
- String content = GetRandomString();
- PersonTextCommand source = new PersonTextCommandImpl();
- source.setId(Id);
- source.setPerson(person);
- source.setOrder(order);
- source.setLevel(level);
- source.setHeading(heading);
- source.setOrder(order);
- source.setContent(content);
- PersonText target = converter.convert(source);
- assertNotNull(target);
- assertEquals(Id, target.getId());
- assertEquals(person, target.getPerson());
- assertEquals(order, target.getOrder());
- assertEquals(level, target.getLevel());
- assertEquals(heading, target.getHeading());
- assertEquals(content, target.getContent());
- }
- }
|