blob: 19c0c6460e8492673f6b97bab56fe7817690d6b3 [file] [log] [blame]
Brian Silvermanf7f267a2017-02-04 16:16:08 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2014-2017. All Rights Reserved. */
3/* Open Source Software - may be modified and shared by FRC teams. The code */
4/* must be accompanied by the FIRST BSD license file in the root directory of */
5/* the project. */
6/*----------------------------------------------------------------------------*/
7
8#include "command/MockCommand.h"
9
10using namespace frc;
11
12MockCommand::MockCommand() {
13 m_initializeCount = 0;
14 m_executeCount = 0;
15 m_isFinishedCount = 0;
16 m_hasFinished = false;
17 m_endCount = 0;
18 m_interruptedCount = 0;
19}
20
21bool MockCommand::HasInitialized() { return GetInitializeCount() > 0; }
22
23bool MockCommand::HasEnd() { return GetEndCount() > 0; }
24
25bool MockCommand::HasInterrupted() { return GetInterruptedCount() > 0; }
26
27void MockCommand::Initialize() { ++m_initializeCount; }
28
29void MockCommand::Execute() { ++m_executeCount; }
30
31bool MockCommand::IsFinished() {
32 ++m_isFinishedCount;
33 return IsHasFinished();
34}
35
36void MockCommand::End() { ++m_endCount; }
37
38void MockCommand::Interrupted() { ++m_interruptedCount; }