-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from f-lab-edu/test/login
�[#16] 로그인 기능 테스트 코드 작성
- Loading branch information
Showing
48 changed files
with
1,387 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,3 +45,7 @@ app.*.map.json | |
# Freezed generated files | ||
*.freezed.dart | ||
*.g.dart | ||
|
||
|
||
# Mockito generated file | ||
*.mocks.dart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export 'api.dart'; | ||
export 'dio_network.dart'; | ||
export 'mock_api.dart'; | ||
export 'api_response.dart'; | ||
export 'dto/dto.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
lib/feature/account/data/data_sources/dto/login/request/login_request_dto.mock.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
part of 'login_request_dto.dart'; | ||
|
||
extension LoginRequestDtoMock on LoginRequestDto { | ||
static LoginRequestDto mock() { | ||
return LoginRequestDto( | ||
accountType: AccountType.company, | ||
loginType: LoginType.email, | ||
loginId: '[email protected]', | ||
password: '123qwe!@', | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
import 'dart:async'; | ||
import 'package:withu_app/core/network/api_response.dart'; | ||
import 'package:withu_app/core/core.dart'; | ||
import 'package:withu_app/feature/account/data/data_sources/dto/dto.dart'; | ||
import 'api.dart'; | ||
|
||
class AccountApiImpl extends AccountApi { | ||
final DioNetwork network; | ||
|
||
AccountApiImpl({required this.network}); | ||
|
||
/// 로그인 API | ||
@override | ||
FutureOr<ApiResponse<LoginResponseDto>> login({ | ||
required LoginRequestDto requestData, | ||
}) async { | ||
return dio | ||
return network.dio | ||
.post( | ||
loginPath, | ||
data: requestData.toJson(), | ||
) | ||
.then((response) => ApiResponse.success( | ||
LoginResponseDto.fromJson(response.data), | ||
)) | ||
.catchError((_) => const ApiResponse<LoginResponseDto>.error()); | ||
.catchError( | ||
(_) => ApiResponse<LoginResponseDto>.fail(FailResponse.error()), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export 'usecase/usecase.dart'; | ||
export 'repository//repository.dart'; | ||
export 'repository/repository.dart'; | ||
export 'entity/entity.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export 'login/login_result_entity.dart'; | ||
export 'login/login.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export 'request/login_request_entity.dart'; | ||
export 'result/login_result_entity.dart'; |
165 changes: 0 additions & 165 deletions
165
lib/feature/account/domain/entity/login/login_result_entity.freezed.dart
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
lib/feature/account/domain/entity/login/request/login_request_entity.converter.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
part of 'login_request_entity.dart'; | ||
|
||
extension LoginRequestEntityConverter on LoginRequestEntity { | ||
/// entity -> dto | ||
LoginRequestDto toDto() { | ||
return LoginRequestDto( | ||
accountType: accountType, | ||
loginType: loginType, | ||
loginId: loginId, | ||
password: password, | ||
); | ||
} | ||
} |
Oops, something went wrong.