๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

TIL, WIL/TIL๐Ÿ“˜

12. 17 TIL : Stack ๊ณต๋ถ€ ์™ธ

728x90

 

1. Stack

Stack์€ ์ž๋ฐ”์˜ Vector ํด๋ž˜์Šค๋ฅผ ์ƒ์†

 

Stack์€ Stack<E>๊ฐ€ ๊ธฐ๋ณธ ํ˜•ํƒœ๋‹ค

 

2. @ParameterizedTest, @ValueSource

https://www.petrikainulainen.net/programming/testing/junit-5-tutorial-writing-parameterized-tests/

 

Writing Parameterized Tests With JUnit 5 - Petri Kainulainen

This blog post describes how we can write parameterized tests with JUnit 5 and configure the arguments which are passed to our test methods.

www.petrikainulainen.net

@ParameterizedTest

๋™์ผํ•œ ํ…Œ์ŠคํŠธ ๋ฉ”์„œ๋“œ๋ฅผ ์—ฌ๋Ÿฌ ๋ฒˆ ์ˆ˜ํ–‰ํ•˜๊ณ  ๋‹ค์–‘ํ•œ ์ž…๋ ฅ ๊ฐ’์œผ๋กœ ํ…Œ์ŠคํŠธ๋ฅผ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋‹ค

~ ํ•ด๋‹น ์–ด๋…ธํ…Œ์ด์…˜์„ ์ž‘์„ฑํ•˜๊ณ  @ValueSource ์–ด๋…ธํ…Œ์ด์…˜์„ ํ™œ์šฉํ•ด ๊ฐ ํ…Œ์ŠคํŠธ ์‹œ ํ• ๋‹นํ•  ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ์„ค์ •ํ•˜๋ฉด, ๊ฐœ๋ฐœ์ž๋Š” ํ•œ ๋ฒˆ๋งŒ ํ…Œ์ŠคํŠธ๋ฅผ ์ˆ˜ํ–‰ํ•ด๋„ ๊ฐ ๊ฐ’์œผ๋กœ ์—ฌ๋Ÿฌ ๋ฒˆ์˜ ํ…Œ์ŠคํŠธ๋ฅผ ๋ชจ๋‘ ์ˆ˜ํ–‰ํ•œ๋‹ค

 

@ValueSource 

ํ…Œ์ŠคํŠธ ๋ฉ”์„œ๋“œ์— ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ์ œ๊ณตํ•  ๋•Œ ์‚ฌ์šฉ๋œ๋‹ค. ํŠน์ •ํ•œ ๊ฐ’์„ ํ•ด๋‹น ๋ฉ”์„œ๋“œ์— ํ• ๋‹นํ•˜๊ณ  ํ…Œ์ŠคํŠธ๋ฅผ ์‹คํ–‰ํ•  ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ์–ด๋…ธํ…Œ์ด์…˜

728x90