class StubbedZIOMethod[A, R] extends StubbedMethod[A, R]
Representation of stubbed method with arguments.
ZIOStubs interface provides implicit conversion from selected method to StubbedMethodZIO.
trait Foo: def foo(x: Int): UIO[String] def bar(x: Int, y: String): IO[String, Int] val foo = stub[Foo]
Scala 3
val fooStubbed: StubbedMethod[Int, UIO[String]] = foo.foo val barStubbed: StubbedMethod[(Int, String), IO[String, Int]] = foo.bar
Scala 2
val fooStubbed: StubbedMethod[Int, UIO[String]] = foo.foo _ val barStubbed: StubbedMethod[(Int, String), IO[String, Int]] = foo.bar _
- Alphabetic
- By Inheritance
- StubbedZIOMethod
- StubbedMethod
- Order
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new StubbedZIOMethod(delegate: StubbedMethod[A, R])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asString: String
Returns string representation of method.
Returns string representation of method. Representation currently depends on scala version.
- Definition Classes
- StubbedZIOMethod → Order
-
def
calls: List[A]
Allows to get arguments with which method was executed.
Allows to get arguments with which method was executed. Returns multiple arguments as tuple. One list item per call.
Scala 3
for { _ <- foo.bar.returnsZIO(_ => ZIO.succeed(5)) _ <- foo.bar(1, "foo") _ <- foo.bar(2, "bar") } yield foo.bar.calls == List((1, "foo"), (2, "bar")) // true
Scala 2
for { _ <- (foo.bar _).returnsZIO(_ => ZIO.succeed(5)) _ <- foo.bar(1, "foo") _ <- foo.bar(2, "bar") } yield (foo.bar _).calls == List((1, "foo"), (2, "bar")) // true
- Definition Classes
- StubbedZIOMethod → StubbedMethod
-
def
callsZIO: UIO[List[A]]
Allows to get arguments with which method was executed.
Allows to get arguments with which method was executed. Returns ZIO
Returns multiple arguments as tuple. One list item per call.
Scala 3
for { _ <- foo.bar.returnsZIO(_ => ZIO.succeed(5)) _ <- foo.bar(1, "foo") _ <- foo.bar(2, "bar") calls <- foo.bar.callsZIO } yield calls == List((1, "foo"), (2, "bar")) // true
Scala 2
for { _ <- (foo.bar _).returnsZIO(_ => ZIO.succeed(5)) _ <- foo.bar(1, "foo") _ <- foo.bar(2, "bar") calls <- (foo.bar _).callsZIO } yield calls == List((1, "foo"), (2, "bar")) // true
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isAfter(other: Order)(implicit callLog: CallLog): Boolean
Returns true if this method was called after other method.
Returns true if this method was called after other method.
- Definition Classes
- StubbedZIOMethod → Order
-
def
isBefore(other: Order)(implicit callLog: CallLog): Boolean
Returns true if this method was called before other method.
Returns true if this method was called before other method.
- Definition Classes
- StubbedZIOMethod → Order
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
returns(f: (A) ⇒ R): Unit
Allows to set result for method with arguments.
Allows to set result for method with arguments.
Scala 3
foo.bar.returns((x, y) => ZIO.succeed(1))
Scala 2
(foo.bar _).returns((x, y) => ZIO.succeed(1))
- Definition Classes
- StubbedZIOMethod → StubbedMethod
-
def
returnsZIO(f: (A) ⇒ R): UIO[Unit]
Allows to set result for method with arguments.
Allows to set result for method with arguments. Returns ZIO
Scala 3
for _ <- foo.bar.returnsZIO((x, y) => ZIO.succeed(1)) yield ()
Scala 2
for { _ <- (foo.bar _).returnsZIO((x, y) => ZIO.succeed(1)) } yield ()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
times: Int
Allows to get number of times method was executed.
Allows to get number of times method was executed.
for { _ <- foo.fooIO.returnsZIO(ZIO.succeed(1)) _ <- foo.fooIO.repeatN(10) } yield foo.fooIO.times == 11 // true
- Definition Classes
- StubbedZIOMethod → StubbedMethod
-
final
def
times(args: A): Int
- Definition Classes
- StubbedMethod
-
def
timesZIO(args: A): UIO[Int]
Allows to get number of times method was executed with specific arguments.
Allows to get number of times method was executed with specific arguments. Returns ZIO
Scala 3
for _ <- foo.bar.returnsZIO(_ => ZIO.succeed(1)) _ <- foo.bar(1, "foo").repeatN(10) barTimes <- foo.bar.timesZIO((1, "foo")) yield barTimes == 11 // true
Scala 2
for { _ <- (foo.bar _).returnsZIO(_ => ZIO.succeed(1)) _ <- foo.bar(1, "foo").repeatN(10) barTimes <- (foo.bar _).timesZIO((1, "foo")) } yield barTimes == 11 // true
-
def
timesZIO: UIO[Int]
Allows to get number of times method was executed.
Allows to get number of times method was executed. Returns ZIO
Scala 3
for _ <- foo.bar.returnsZIO(_ => ZIO.succeed(1)) _ <- foo.bar(1, "foo").repeatN(10) barTimes <- foo.bar.timesZIO yield barTimes == 11 // true
Scala 2
for { _ <- (foo.bar _).returnsZIO(_ => ZIO.succeed(1)) _ <- foo.bar(1, "foo").repeatN(10) barTimes <- (foo.bar _).timesZIO } yield barTimes == 11 // true
-
def
toString(): String
- Definition Classes
- StubbedZIOMethod → AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()