| 18 | Assert::AreEqual(0, counter.apm(false)); |
| 19 | } |
| 20 | TEST_METHOD(APMCounterReflects204APM) |
| 21 | { |
| 22 | APMCounter counter; |
| 23 | counter.init(); |
| 24 | |
| 25 | // Send a command every 7th frame for 50 frames. |
| 26 | for (int frame = 1; frame < 50; ++frame) |
| 27 | { |
| 28 | if (frame % 7 == 0) counter.addSelect(); |
| 29 | counter.update(frame); |
| 30 | } |
| 31 | |
| 32 | // If you send a command every 7th frame for a full minute on fastest speed: |
| 33 | // (60000ms / 42ms/frame = 1428.57.. frames) / 7frames/action = 204.08.. actions in a minute |
| 34 | Assert::AreEqual(204, counter.apm()); |
| 35 | } |
| 36 | }; |
| 37 | } |