File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
src/test/java/com/somemore/global/imageupload/validator Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -93,4 +93,43 @@ void shouldThrowExceptionWhenFileTypeIsNull() {
9393 // then
9494 assertEquals (ImageUploadException .class , exception .getClass ());
9595 }
96+
97+ @ Test
98+ @ DisplayName ("파일 이름이 비어있는지 확인할 수 있다." )
99+ void shouldReturnTrueWhenFileNameIsEmpty () {
100+ // given
101+ String emptyFileName = "" ;
102+
103+ // when
104+ boolean isEmptyFileName = imageUploadValidator .isEmptyFileName (emptyFileName );
105+
106+ // then
107+ assertThat (isEmptyFileName ).isTrue ();
108+ }
109+
110+ @ Test
111+ @ DisplayName ("파일 이름이 null이면 true를 반환한다." )
112+ void shouldReturnTrueWhenFileNameIsNull () {
113+ // given
114+ String nullFileName = null ;
115+
116+ // when
117+ boolean isEmptyFileName = imageUploadValidator .isEmptyFileName (nullFileName );
118+
119+ // then
120+ assertThat (isEmptyFileName ).isTrue ();
121+ }
122+
123+ @ Test
124+ @ DisplayName ("파일 이름이 비어있지 않으면 false를 반환한다." )
125+ void shouldReturnFalseWhenFileNameIsNotEmpty () {
126+ // given
127+ String validFileName = "testImage.jpg" ;
128+
129+ // when
130+ boolean isEmptyFileName = imageUploadValidator .isEmptyFileName (validFileName );
131+
132+ // then
133+ assertThat (isEmptyFileName ).isFalse ();
134+ }
96135}
You can’t perform that action at this time.
0 commit comments