
1. Annotation 2. Mock Object 3. Method Stub 4. Spy Object 5. Assert 6. Verify 6. Verify class UnitLocalDataSourceTest { lateinit var unitLocalDataSource: UnitLocalDataSource val map = mutableMapOf() val testUnitId = "testId" @MockK lateinit var unitSettings: UnitSettings @MockK lateinit var testUnit: Unit @Test fun testGetUnit_found() { every { spyMap.get(testUnit.id.toString()) } returns testUn..

1. Annotation 2. Mock Object 3. Method Stub 4. Spy Object 5. Assert 6. Verify 5. Assert class UnitLocalDataSourceTest { lateinit var unitLocalDataSource: UnitLocalDataSource val map = mutableMapOf() val testUnitId = "testId" @MockK lateinit var unitSettings: UnitSettings @MockK lateinit var testUnit: Unit @Test fun testGetUnit_found() { every { spyMap.get(testUnit.id.toString()) } returns testUn..

1. Annotation 2. Mock Object 3. Method Stub 4. Spy Object 5. Assert 6. Verify 4. Spy Object class UnitLocalDataSourceTest { lateinit var unitLocalDataSource: UnitLocalDataSource val map = mutableMapOf() // 실제 Map 객체를 감싸 Spy 객체 생성 @SpyK val spyMap = spyk(map) @MockK lateinit var unitSettings: UnitSettings @MockK lateinit var testUnit: Unit @Test fun testPutUnit() { unitLocalDataSource.putUnit(tes..

1. Annotation 2. Mock Object 3. Method Stub 4. Spy Object 5. Assert 6. Verify 3. Method Stub class UnitRepositoryImplTest { @MockK(relaxUnitFun = true) lateinit var unitDataSource: UnitDataSource lateinit var unitRepository: UnitRepository private val unitRequest = "unitId" @Before fun setup() { MockKAnnotations.init(this) unitRepository = UnitRepositoryImpl(unitServiceApi, unitDataSource, sched..

1. Annotation 2. Mock Object 3. Method Stub 4. Spy Object 5. Assert 6. Verify 2. Mock Object class UnitRepositoryImplTest { // Mock 객체 선언 @MockK(relaxUnitFun = true) lateinit var unitDataSource: UnitDataSource lateinit var unitRepository: UnitRepository private val unitRequest = "unitId" @Before fun setup() { MockKAnnotations.init(this) unitRepository = UnitRepositoryImpl(unitServiceApi, unitDat..

1. Annotation 2. Mock Object 3. Method Stub 4. Spy Object 5. Assert 6. Verify 1. Annotation public class Test { @Before public void setUp() { MockitoAnnotations.initMocks(this); when(adRepository.getAd()).thenReturn(ad); } @Test public void testGetAd_Success() { val actual = getAdUseCase.execute(adId) verify(adRepository).getAd(adId); } } @Before 테스트를 작성할 때, 테스트 실행 이전에 공통적으로 필요한 객체를 미리 생성하는 것이 일..
- Total
- Today
- Yesterday
- 테스트
- 컴포즈 초기화
- 유닛테스트
- 유닛 테스트
- compose ui
- 안드로이드 단위 테스트
- android unit test
- 안드로이드 컴포즈
- 안드로이드 테스트
- AOS
- Leetcode
- Android
- ViewCompositionStrategy
- android compose
- Unit
- 안드로이드 커스텀 버튼
- 안드로이드 유닛 테스트
- 구글
- 코딩테스트
- 안드로이드 종속성 주입
- 안드로이드
- 알고리즘 풀이
- 알고리즘
- android test
- android custom button
- button padding
- unit test
- 커스텀 버튼
- androud hilt
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |