Skip to content

Commit

Permalink
test(Media) : media 도메인 테스트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
EunjiShin committed Jul 9, 2024
1 parent 596c9b6 commit b2290f0
Showing 1 changed file with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class MediaTest {

@Test
public void url_없으면_미디어를_생성할__없다() {
public void url_공백이면_미디어를_생성할__없다() {
// given
final String url = "";
final String fileName = "file";
Expand All @@ -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 = "";
Expand Down

0 comments on commit b2290f0

Please sign in to comment.