Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] 날짜 정규식, 색상-문자열 변환 단위 테스트 #97

Merged
merged 57 commits into from
Nov 2, 2020
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
6e8cddd
[server] chore: eslint 옵션 추가 및 nodemon 설정
skid901 Oct 29, 2020
658453b
[server] refactor: labels api 코드 수정
skid901 Oct 29, 2020
4eb0761
Merge pull request #63 from boostcamp-2020/feat/server/labels-api-fix
Oct 29, 2020
8c69d6d
[server] feat: milestones api 초기 세팅
skid901 Oct 29, 2020
fca5c43
Merge pull request #64 from boostcamp-2020/feat/server/milestones-api…
Oct 29, 2020
238bab8
[server] feat: Milestone 수정 API
seokju2ng Oct 29, 2020
7e74ee5
[server] feat: Milestone 삭제 API
seokju2ng Oct 29, 2020
97b5e98
[server] feat: milestone 추가 API
Oct 29, 2020
cc4b26c
Merge pull request #68 from boostcamp-2020/feat/server/milestones-api…
seokju2ng Oct 29, 2020
25f12d3
Merge pull request #65 from boostcamp-2020/feat/server/milestones-api…
Oct 29, 2020
f9cce9a
Merge pull request #67 from boostcamp-2020/feat/server/milestones-api…
Oct 29, 2020
510719a
[server] feat: milestones API 조회
skid901 Oct 29, 2020
94eeb9e
Merge pull request #69 from boostcamp-2020/feat/server/milestones-api…
seokju2ng Oct 29, 2020
49d2404
[server] refactor: milestones 테이블 제약조건 추가
skid901 Oct 29, 2020
545d6f7
Merge pull request #70 from boostcamp-2020/feat/server/milestones-api…
seokju2ng Oct 29, 2020
4cfac6a
[server] feat: issue seeder 추가
skid901 Oct 29, 2020
72c9f2c
Merge pull request #72 from boostcamp-2020/feat/server/add-issue-seeder
Oct 29, 2020
c3ab65b
[server] feat: 에러 핸들러 모듈 구현
skid901 Oct 29, 2020
e038a87
Merge pull request #76 from boostcamp-2020/feat/server/error-handler-…
Oct 29, 2020
c20071c
[server] feat: labels 조회 API error handler 적용
Oct 29, 2020
c2b6936
[server] feat: 에러 핸들러 적용 - 레이블 추가
seokju2ng Oct 29, 2020
f2d4b7f
[server] feat: label 삭제 API error handler 적용
Oct 29, 2020
1def58c
[server] feat: 에러 핸들러 적용 - 마일스톤 수정, 삭제
seokju2ng Oct 29, 2020
0a69c2a
[server] feat: milestone 등록 API error handler 적용
Oct 29, 2020
0b4d379
Merge pull request #77 from boostcamp-2020/feat/server/error-handler1
Oct 29, 2020
d0f32a1
Merge branch 'dev_web' into feat/server/error-handler3
seokju2ng Oct 29, 2020
8875797
[server] feat: 에러 핸들러 적용 - 라벨 단건 조회, 수정 및 마일스톤 조회
skid901 Oct 29, 2020
c1837cb
Merge pull request #78 from boostcamp-2020/feat/server/error-handler3
seokju2ng Oct 29, 2020
c1e4ee2
Merge branch 'dev_web' into feat/server/error-handler2
skid901 Oct 29, 2020
5fae962
Merge pull request #79 from boostcamp-2020/feat/server/error-handler2
seokju2ng Oct 29, 2020
5e11bba
[server] fix: date 유효성 확인 error handler 모듈 적용
Oct 29, 2020
dc8210e
Merge pull request #81 from boostcamp-2020/feat/server/error-handler-…
seokju2ng Oct 29, 2020
46897f6
[server] fix: milestone 전체 목록 조회 API 수정
skid901 Oct 29, 2020
65a4ff2
[server] fix: milestone 수정 API 수정
skid901 Oct 29, 2020
2fa87f1
Merge pull request #85 from boostcamp-2020/feat/server/milestones-api…
Oct 29, 2020
c4feb98
[server] refactor: 에러 핸들러 로직 수정
seokju2ng Oct 30, 2020
3869d07
[common] docs: README.md 수정
seokju2ng Oct 30, 2020
45c5adb
Merge pull request #89 from boostcamp-2020/feat/server/error-handler-…
skid901 Oct 30, 2020
687083b
Merge pull request #87 from boostcamp-2020/dev_web
seokju2ng Oct 30, 2020
06d75ea
[server] chore: 테스트 데이터 수정
skid901 Oct 30, 2020
86697c8
Merge pull request #91 from boostcamp-2020/feat/server/sample-data-mo…
Oct 30, 2020
ce43de3
[common] docs: README.md 내용 추가
Oct 30, 2020
e628eef
Merge pull request #90 from boostcamp-2020/feat/README
skid901 Oct 30, 2020
6f4ae05
[common] docs: README.md 수정
kyungpyoda Oct 30, 2020
0526ce9
[server] refactor: Milestone 전체 조회 API 리팩토링
skid901 Oct 30, 2020
6c0c398
[common] docs: README.md 수정
skid901 Oct 30, 2020
961e86b
[common] docs: README.md 기술 스택 표 수정
skid901 Oct 30, 2020
b54c9fe
Merge pull request #94 from boostcamp-2020/feat/edit-readme
seokju2ng Oct 30, 2020
cfdf8ad
Merge pull request #80 from boostcamp-2020/dev_iOS
kyungpyoda Oct 30, 2020
1d6c3f2
Merge pull request #93 from boostcamp-2020/feat/server/milestones-get…
seokju2ng Oct 30, 2020
22395f3
Merge pull request #95 from boostcamp-2020/dev_web
Oct 30, 2020
2f3fecc
[iOS] refactor: 날짜 정규식 String Extension 으로 이동, 정규식 로직 수정
kyungpyoda Oct 29, 2020
2990c40
[iOS] style: 주석 제거 및 MARK 추가
kyungpyoda Oct 29, 2020
64faf22
[iOS] test: 날짜 정규식, 색상-문자열 변환 단위 테스트 구현
kyungpyoda Oct 29, 2020
577e22b
[iOS] chore: Code Coverage 활성화
kyungpyoda Nov 2, 2020
17de715
[iOS] test: 색상-문자열 변환 단위 테스트 수정
kyungpyoda Nov 2, 2020
fca0173
[iOS] style: 테스트 코드 네이밍 컨벤션 적용
kyungpyoda Nov 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 26 additions & 13 deletions iOS/IssueTracker/IssueTrackerTests/IssueTrackerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ import XCTest

class IssueTrackerTests: XCTestCase {

func testDateRegularExpression() throws {
// MARK: - Regular Expression

func test_regularExpression_withValidDate_shouldNotBeNil() throws {
let valid = "2020-12-31"
XCTAssertNotNil(valid.dateRegEx)
XCTAssertEqual(valid, valid.dateRegEx)
}

func test_regularExpression_withInvalidDate_shouldBeNil() throws {
let invalidFormat = "20201231"
XCTAssertNil(invalidFormat.dateRegEx)
let invalidMonth = "2020-13-31"
Expand All @@ -22,19 +27,27 @@ class IssueTrackerTests: XCTestCase {
XCTAssertNil(invalidDay.dateRegEx)
}

func testUIColorHexString() throws {
// MARK: - UIColor+String

func test_UIColorToHexString_withRGBColorNotGrayScale() throws {
let redHex = UIColor.red.hexString
XCTAssertEqual(redHex, "#FF0000")
let blueHex = UIColor.blue.hexString
XCTAssertEqual(blueHex, "#0000FF")
let blackHex = UIColor.init(red: 0, green: 0, blue: 0, alpha: 1).hexString
XCTAssertEqual(blackHex, "#000000")
}

func test_hexStringToUIColor_withValidString() throws {
let redHex = "#FF0000"
let red = UIColor(hex: redHex)
XCTAssertEqual(red, UIColor.red)
XCTAssertEqual(redHex, red?.hexString)
let blueHex = "0000FF"
let blue = UIColor(hex: blueHex)
XCTAssertEqual(blue, UIColor.blue)
XCTAssertEqual("#" + blueHex, blue?.hexString)
let blackHex = "000000"
let black = UIColor(hex: blackHex)
XCTAssertEqual(black, UIColor.init(red: 0, green: 0, blue: 0, alpha: 1))
XCTAssertEqual("#" + blackHex, black?.hexString)
XCTAssertEqual(UIColor.init(hex: redHex), UIColor.red)
let blueHex = "#0000FF"
XCTAssertEqual(UIColor.init(hex: blueHex), UIColor.blue)
let blackHex = "#000000"
XCTAssertEqual(UIColor.init(hex: blackHex), UIColor.init(red: 0, green: 0, blue: 0, alpha: 1))
}

func test_hexStringToUIColor_withInvalidString_shouldBeNil() throws {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXCELLENT !!

let invalidHex1 = "#FF00000"
let invalid1 = UIColor(hex: invalidHex1)
XCTAssertNil(invalid1)
Expand Down