package category;

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

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

class CategoryNameTest {

	@Test
	void getNameWorks() throws IllegalValueObjectArgument {
		String name = "libaries";
		CategoryName sut = new CategoryName(name);

		assertEquals(name, sut.getName());
	}

	@Test
	void constructorThrowsNull() {
		String nullString = null;
		assertThrows(IllegalValueObjectArgument.class, () -> new CategoryName(nullString));
	}

	@Test
	void constructorThrowsBlank() {
		String blankString = "    ";
		assertThrows(IllegalValueObjectArgument.class, () -> new CategoryName(blankString));
	}

	@Test
	void constructorThrowsEmpty() {
		String emptyString = "";
		assertThrows(IllegalValueObjectArgument.class, () -> new CategoryName(emptyString));
	}

	@Test
	void constructorThrowsTooShort() {
		String shortString = "da";
		assertThrows(IllegalValueObjectArgument.class, () -> new CategoryName(shortString));
	}

	@Test
	void testEquals() {
	}

}
