package link;

import exeptions.IllegalValueObjectArgument;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

class LinkUrlTest {

	@Test
	void constructorWorks() {
		assertDoesNotThrow(() -> new LinkUrl("https://tea.filefighter.de/qvalentin/LinkDitch"));
	}

	@Test
	void constructorThrows() {
		assertThrows(IllegalValueObjectArgument.class, () -> new LinkUrl("tea.filefighter.de/qvalentin/LinkDitch"));
	}

	@Test
	void testToString() throws IllegalValueObjectArgument {
		String urlString = "https://tea.filefighter.de/qvalentin/LinkDitch";
		LinkUrl sut = new LinkUrl(urlString);

		assertEquals(urlString, sut.toString());
	}
}
