Skip to content

Instantly share code, notes, and snippets.

@wsoczynski
Created March 21, 2012 11:00
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/2146191 to your computer and use it in GitHub Desktop.
Save wsoczynski/2146191 to your computer and use it in GitHub Desktop.
Wiedz, że coś się dzieje 3
class Bar(var i: Int) {
}
class Baz(bar: Bar) {
var barProperty = bar
}
class TestSubject2 {
def doFoo(baz: Baz):Int ={
val someUsefulValue = baz.barProperty.i
return doRealyFoo(someUsefulValue)
}
private def doRealyFoo(input: Int):Int = {
return input + 10
}
}
def testCase2() {
val bar = new Bar(10)
val baz = new Baz(bar)
val testedObject = new TestCase2
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