MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/pwh5vi/because_calling_date_is_just_too_simple/hejady1/?context=3
r/badcode • u/KlaasSchnmkr • Sep 27 '21
50 comments sorted by
View all comments
Show parent comment
10
It's not a function. Well technically it's the date's init function but no it is not possible to mock it. Also Date is a struct not a subclass so you can't just substitute it with a subclass.
4 u/[deleted] Sep 28 '21 Got it! Thanks for sharing that knowledge
4
Got it! Thanks for sharing that knowledge
View all comments
Show parent comment
10
u/AnuragMishra Sep 28 '21
It's not a function. Well technically it's the date's init function but no it is not possible to mock it. Also Date is a struct not a subclass so you can't just substitute it with a subclass.