Feature/home view model test#196
Open
VitorCampos28 wants to merge 17 commits into
Open
Conversation
add final to class Co-authored-by: Leonardo <42387881+leocoout@users.noreply.github.com>
solving problem with string test Co-authored-by: Leonardo <42387881+leocoout@users.noreply.github.com>
Co-authored-by: Leonardo <42387881+leocoout@users.noreply.github.com>
…trollerExtensionsTests.swift Co-authored-by: Leonardo <42387881+leocoout@users.noreply.github.com>
…trollerExtensionsTests.swift Co-authored-by: Leonardo <42387881+leocoout@users.noreply.github.com>
Feature/removing spaces
…roller Feature/inside navigation controller
DispatchQueueSpy created
leocoout
reviewed
Nov 21, 2022
| let delegateSpy = HomeViewModelDelegateSpy() | ||
| lazy var sut = HomeViewModel(financeService: financeServiceSpy, dispatchQueue: dispatchQueueSpy) | ||
|
|
||
| func test_didFetchHomeData_isCalled () { |
Contributor
There was a problem hiding this comment.
Suggested change
| func test_didFetchHomeData_isCalled () { | |
| func test_fetchHomeData_shouldCallDelegate() { |
| XCTAssertTrue(delegateSpy.delegateIsCalled) | ||
| } | ||
|
|
||
| func test_fetchHomeDataAndDispatchQueue_isCalled() { |
Contributor
There was a problem hiding this comment.
Suggested change
| func test_fetchHomeDataAndDispatchQueue_isCalled() { | |
| func test_fetchHomeData_whenDataIsNotNil_shouldCallDispatch() { |
| XCTAssertTrue(dispatchQueueSpy.isDispatchCalled) | ||
| } | ||
|
|
||
| func test_fetchData_shouldNotCallDelegate_whenHomedataIsNill () { |
Contributor
There was a problem hiding this comment.
Suggested change
| func test_fetchData_shouldNotCallDelegate_whenHomedataIsNill () { | |
| func test_fetchData_whenHomedataIsNill _shouldNotCallDelegate() { |
| } | ||
|
|
||
| class HomeViewModelDelegateSpy: HomeViewModelDelegate { | ||
| var delegateIsCalled: Bool = false |
Contributor
There was a problem hiding this comment.
Suggested change
| var delegateIsCalled: Bool = false | |
| private(set) var delegateIsCalled: Bool = false |
|
|
||
| class FinanceServiceSpy: FetchHomeDataProtocol { | ||
|
|
||
| var homeData: HomeData? = HomeData(balance: 0, savings: 0, spending: 0, activity: [Activity(name: "", price: 0, time: "")]) |
Contributor
There was a problem hiding this comment.
O que você acha de utilizarmos uma fixture
| class FinanceServiceSpy: FetchHomeDataProtocol { | ||
|
|
||
| var homeData: HomeData? = HomeData(balance: 0, savings: 0, spending: 0, activity: [Activity(name: "", price: 0, time: "")]) | ||
| var fetchHomeDataIsCalled: Bool = false |
Contributor
There was a problem hiding this comment.
Suggested change
| var fetchHomeDataIsCalled: Bool = false | |
| private(set) var fetchHomeDataIsCalled: Bool = false |
|
|
||
| public class DispatchQueueSpy: DispatchQueueProtocol { | ||
|
|
||
| var isDispatchCalled: Bool = false |
Contributor
There was a problem hiding this comment.
Suggested change
| var isDispatchCalled: Bool = false | |
| private(set) var isDispatchCalled: Bool = false |
| @@ -5,7 +5,12 @@ import Foundation | |||
| @testable import FinanceApp | |||
|
|
|||
| public class DispatchQueueSpy: DispatchQueueProtocol { | |||
Contributor
There was a problem hiding this comment.
Suggested change
| public class DispatchQueueSpy: DispatchQueueProtocol { | |
| final class DispatchQueueSpy: DispatchQueueProtocol { |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
------------ APAGAR ------------
Emojis para os titulos dos MR's
More on: https://gitmoji.dev
------------ APAGAR ------------
Descrição simples da nova feature
Checklist:
Coloque um
xnas caixas que se aplicam.Evidências da feature: