Created
March 21, 2012 11:14
-
-
Save wsoczynski/2146273 to your computer and use it in GitHub Desktop.
Wiedz, że coś się dzieje 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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