Kev
02/02/2024, 5:53 AMwhenever
parameter in an either, and then also have to turn the returning option into an either also.
I included the method signature as a comment within the snippet.
// context(Raise<Error>) getScopedMethod(value: String): Option<Foo>
val mocked = mock<SomeScope> {
whenever(either { it.getScopedMethod(any()) }).thenReturn(Foo("foo").some().right())
}
Riccardo Cardin
02/02/2024, 6:17 AMsimon.vergauwen
02/02/2024, 9:05 AMsimon.vergauwen
02/02/2024, 9:06 AMCLOVIS
02/02/2024, 9:09 AMKev
02/02/2024, 9:32 AMRiccardo Cardin
02/02/2024, 9:35 AMsimon.vergauwen
02/02/2024, 9:37 AMRiccardo Cardin
02/02/2024, 9:38 AMsimon.vergauwen
02/02/2024, 9:38 AMRiccardo Cardin
02/02/2024, 9:40 AMDaniel Ciocirlan
02/02/2024, 12:42 PM