Group Group Group Group Group Group Group Group Group

Errata for Android Test-Driven Development by Tutorials 1st Edition

Creating this topic to catch any typos and bugs in the 1st Edition of Android Test-Driven Development by Tutorials.

Hi. p106 of the digital edition of the book (Chapter 6 : Architecting for Testing)

interface Space

data class RectangularSpace(val width: Double, val height: Double): Space

data class CircularSpace(radius: Double): Space

class ArchitectUtils {
	...
	fun calculateArea(spaces: List<Space>) {
		var total = 0
		for (space in spaces) {
			if (space is SquareSpace) {
				total += space.width * space.height
			} elseif (space is CircularSpace) {
				total += space.radius * space.radius * PI
			}
		}
		return total
	}
}

I believe it should be

if (space is RectangularSpace)

not SquareSpace