Brian Silverman | 1a67511 | 2016-02-20 20:42:49 -0500 | [diff] [blame^] | 1 | /*----------------------------------------------------------------------------*/ |
| 2 | /* Copyright (c) FIRST 2016. 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 | |
Brian Silverman | 26e4e52 | 2015-12-17 01:56:40 -0500 | [diff] [blame] | 8 | #pragma once |
| 9 | |
| 10 | #include <Commands/Command.h> |
| 11 | |
| 12 | class MockCommand : public Command { |
| 13 | private: |
| 14 | int m_initializeCount; |
| 15 | int m_executeCount; |
| 16 | int m_isFinishedCount; |
| 17 | bool m_hasFinished; |
| 18 | int m_endCount; |
| 19 | int m_interruptedCount; |
| 20 | |
| 21 | protected: |
| 22 | virtual void Initialize(); |
| 23 | virtual void Execute(); |
| 24 | virtual bool IsFinished(); |
| 25 | virtual void End(); |
| 26 | virtual void Interrupted(); |
| 27 | |
| 28 | public: |
| 29 | MockCommand(); |
| 30 | int GetInitializeCount() { return m_initializeCount; } |
| 31 | bool HasInitialized(); |
| 32 | |
| 33 | int GetExecuteCount() { return m_executeCount; } |
| 34 | int GetIsFinishedCount() { return m_isFinishedCount; } |
| 35 | bool IsHasFinished() { return m_hasFinished; } |
| 36 | void SetHasFinished(bool hasFinished) { m_hasFinished = hasFinished; } |
| 37 | int GetEndCount() { return m_endCount; } |
| 38 | bool HasEnd(); |
| 39 | |
| 40 | int GetInterruptedCount() { return m_interruptedCount; } |
| 41 | bool HasInterrupted(); |
| 42 | }; |