Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
##2주차 테스트코드 실습 과제
오늘 있었던 문제
MainViewController에 있던 이메일 / 패스워드 유효성 검사 로직이private메서드여서테스트 코드에서 직접 접근할 수 없는 문제가 발생 처음에는 그냥 메서드에서 private을 지우고 internal로 변경해줬습니다.
그러나 이건 별로 좋은 방법은 아닌거 같아서 서치를 해봤습니다.
테스트할 함수를 담은 별도의 Validator 객체로 분리 하는 방식이 괜찮아 보였습니다
변경 사항
LoginValidator 객체 만들기
기존
MainViewController의isValidEmail(_:),isValidPassword(_:)을 Validator로 이동했습니다.MainViewController는 이제 Validator를 통해 검사를 수행하도록 수정했습니다.테스트가 불가능했던
private메서드는 Validator 메서드로 대체했습니다.