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

Can't generate a mock for protocol where Self: Class #447

Open
alxdenis opened this issue Jan 24, 2023 · 0 comments
Open

Can't generate a mock for protocol where Self: Class #447

alxdenis opened this issue Jan 24, 2023 · 0 comments
Labels
help wanted This issue is asking for a way to solve a problem.

Comments

@alxdenis
Copy link

Hello,

I create a Cuckoo Mock for this protocol . I precise that ViewModel is a Class.

protocol TravelersViewModelProtocol where Self: ViewModel {
    var membersDetailsCellViewModel: ParticipantsCellViewModel { get }
    var organizerCellViewModel: OrganizerCellViewModel { get }
    var invitationCellViewModels: [InvitationCellViewModel]? { get }
    var footerText: NSAttributedString { get }
    var logger: LoggerProtocol { get }
    var tracker: TrackerProtocol { get }
    func fetchInvitations()
    func sendCoTravelersScreenEvent()
}

However, I face this issue

type 'MockTravelersViewModelProtocol' does not conform to protocol 'TravelersViewModelProtocol'
TravelersViewModelProtocol' requires that 'MockTravelersViewModelProtocol' inherit from 'ViewModel'

I completely understand the issue but I don't know how to solve it.

Do you have any idea ?

Thanks in advance

@alxdenis alxdenis changed the title Error when mock protocol where Self: Class Can't generate a mock for protocol where Self: Class Jan 24, 2023
@MatyasKriz MatyasKriz added the help wanted This issue is asking for a way to solve a problem. label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted This issue is asking for a way to solve a problem.
Projects
None yet
Development

No branches or pull requests

2 participants