Skip to content

Improve support for mocked properties #10

@danielsaidi

Description

@danielsaidi

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: ())
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions