From b2290f091cb918fa1c0a089066f66c9061561e78 Mon Sep 17 00:00:00 2001 From: EunjiShin Date: Tue, 9 Jul 2024 21:40:29 +0900 Subject: [PATCH] =?UTF-8?q?test(Media)=20:=20media=20=EB=8F=84=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spot/domain/media/MediaTest.java | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/domain/src/test/java/org/depromeet/spot/domain/media/MediaTest.java b/domain/src/test/java/org/depromeet/spot/domain/media/MediaTest.java index c787f4f7..ea4deb9e 100644 --- a/domain/src/test/java/org/depromeet/spot/domain/media/MediaTest.java +++ b/domain/src/test/java/org/depromeet/spot/domain/media/MediaTest.java @@ -8,7 +8,7 @@ class MediaTest { @Test - public void url이_없으면_미디어를_생성할_수_없다() { + public void url이_공백이면_미디어를_생성할_수_없다() { // given final String url = ""; final String fileName = "file"; @@ -20,7 +20,31 @@ class MediaTest { } @Test - public void fileName이_없으면_미디어를_생성할_수_없다() { + public void url이_null이면_미디어를_생성할_수_없다() { + // given + final String url = null; + final String fileName = "file"; + + // when + // then + assertThatThrownBy(() -> new Media(url, fileName)) + .isInstanceOf(InvalidMediaException.class); + } + + @Test + public void fileName이_공백이면_미디어를_생성할_수_없다() { + // given + final String url = "url"; + final String fileName = ""; + + // when + // then + assertThatThrownBy(() -> new Media(url, fileName)) + .isInstanceOf(InvalidMediaException.class); + } + + @Test + public void fileName이_null이면_미디어를_생성할_수_없다() { // given final String url = "url"; final String fileName = "";