Skip to content

Instantly share code, notes, and snippets.

@wsoczynski
Created March 21, 2012 11:14
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 wsoczynski/2146273 to your computer and use it in GitHub Desktop.
Save wsoczynski/2146273 to your computer and use it in GitHub Desktop.
Wiedz, że coś się dzieje 4
class BazRefactored(bar: Bar) {
def doRealyFoo(input: Int):Int = {
return bar.i + input
}
}
class BazRefactoredMock extends BazRefactored(new Bar(10)) {
}
class TestSubject2refactored {
def doFoo(baz: BazRefactored):Int ={
val result = baz.doRealyFoo(10)
return result
}
}
def testCase2refactored() {
val baz = new BazRefactoredMock;
val testedObject = new TestSubject2refactored
val result = testedObject.doFoo(baz)
if(result == 20){
println("true")
} else {
println("false")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment