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

Improve support for mocked properties #10

Open
danielsaidi opened this issue Jul 17, 2020 · 0 comments
Open

Improve support for mocked properties #10

danielsaidi opened this issue Jul 17, 2020 · 0 comments
Labels
feature New feature or request

Comments

@danielsaidi
Copy link
Owner

This currently doesn't work:

class MockStore: Mock, Store {
    
    lazy var hasContentRef = MockReference(hasContent) <-- hasContent is not a function
    lazy var deleteContentRef = MockReference(deleteContent)
    
    // --> Which requires us to do this:
    var hasContentInvokeCount = 0
    var hasContentReturnValue = false
    public var hasContent: Bool {
        hasContentInvokeCount += 1
        return hasContentReturnValue
    }
    
    public func deleteContent() {
        invoke(deleteContentRef, args: ())
    }
}
@danielsaidi danielsaidi added the feature New feature or request label Jul 17, 2020
@danielsaidi danielsaidi changed the title Make it possible to mock properties Improve support for mocked properties Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant