Skip to content

Instantly share code, notes, and snippets.

@pinguinson
Created February 11, 2018 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pinguinson/e6461b70105096eb8ef44562cc27ad5a to your computer and use it in GitHub Desktop.
Save pinguinson/e6461b70105096eb8ef44562cc27ad5a to your computer and use it in GitHub Desktop.
class Example(serviceA: ServiceA, serviceB: ServiceB, serviceC: ServiceC) {
def sum(x: Int, y: Int): Int = {
serviceA.foo(x)
serviceB.bar(y)
// Doesn't call serviceC, so any test expecting it should fail
x + y
}
}
trait ServiceA {
def foo(x: Int): Unit
}
trait ServiceB {
def bar(y: Int): Unit
}
trait ServiceC {
def baz(z: Int): String
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment