Brian Silverman | 26e4e52 | 2015-12-17 01:56:40 -0500 | [diff] [blame^] | 1 | /*----------------------------------------------------------------------------*/ |
| 2 | /* Copyright (c) FIRST 2014. 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 | |
| 10 | MockCommand::MockCommand() { |
| 11 | m_initializeCount = 0; |
| 12 | m_executeCount = 0; |
| 13 | m_isFinishedCount = 0; |
| 14 | m_hasFinished = false; |
| 15 | m_endCount = 0; |
| 16 | m_interruptedCount = 0; |
| 17 | } |
| 18 | |
| 19 | void MockCommand::Initialize() { ++m_initializeCount; } |
| 20 | |
| 21 | void MockCommand::Execute() { ++m_executeCount; } |
| 22 | |
| 23 | bool MockCommand::IsFinished() { |
| 24 | ++m_isFinishedCount; |
| 25 | return IsHasFinished(); |
| 26 | } |
| 27 | |
| 28 | void MockCommand::End() { ++m_endCount; } |
| 29 | |
| 30 | void MockCommand::Interrupted() { ++m_interruptedCount; } |
| 31 | |
| 32 | bool MockCommand::HasInitialized() { return GetInitializeCount() > 0; } |
| 33 | |
| 34 | bool MockCommand::HasEnd() { return GetEndCount() > 0; } |
| 35 | |
| 36 | bool MockCommand::HasInterrupted() { return GetInterruptedCount() > 0; } |