 
 }
 
+extension XCTest {
+
+  func XCTAssertThrow<R, E where E: ErrorType, E: Equatable>(expectedError: E, @autoclosure _ closure: () throws -> R) -> () {
+    do {
+      try closure()
+      XCTFail("Expected error \"\(expectedError)\", " + "but closure succeeded.")
+    } catch let error as E {
+      XCTAssertEqual(error, expectedError,
+          "Catched error is from expected type, but not the expected case.")
+    } catch {
+      XCTFail("Catched error \"\(error)\", "
+          + "but not the expected error "
+          + "\"\(expectedError)\".")
+    }
+  }
+}
 
 
+

    return ExecuteActionSpy()
  }

  func AssertThrow<R, E where E: ErrorType, E: Equatable>(expectedError: E, @autoclosure _ closure: () throws -> R) -> () {
    do {
      try closure()
      XCTFail("Expected error \"\(expectedError)\", " + "but closure succeeded.")
    } catch let error as E {
      XCTAssertEqual(error, expectedError,
          "Catched error is from expected type, but not the expected case.")
    } catch {
      XCTFail("Catched error \"\(error)\", "
          + "but not the expected error "
          + "\"\(expectedError)\".")
    }
  }
}

class CanNotExecuteActionStub: Action {

  }

  func givenDirection() -> Direction {
    return DirectionSpy()
  }

  func initialPositionLookingAt(direction: Direction) -> Position {
    return Position(point: initialPoint, direction: direction)
  }

  func givenMarsRoverAt(position: Position, actions: [Action] = [Action]()) -> MarsRover {
    return MarsRover(initialPosition: position, actions: actions)
  }

  func givenMarsRoverAtInitialPositionWith(action: Action) -> MarsRover {
