Skip to content

Commit

Permalink
Fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
Crazy767 committed May 8, 2024
1 parent cc554e6 commit a3ea5c4
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions test/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,6 @@
using ::testing::_;
using ::testing::Throw;

class SleepStrategy {
public:
virtual void sleep(int seconds) = 0;
};

class RealSleepStrategy : public SleepStrategy {
public:
void sleep(int seconds) override {
::sleep(seconds);
}
};

class MockSleepStrategy : public SleepStrategy {
public:
MOCK_METHOD(void, sleep, (int seconds), (override));
};

class MockTimerClient : public TimerClient {
public:
MOCK_METHOD(void, Timeout, (), (override));
Expand Down Expand Up @@ -79,10 +62,7 @@ TEST_F(TimedDoorTest, TimeoutCalledOnOpenDoor) {

TEST_F(TimedDoorTest, NoTimeoutCalledOnClosedDoor) {
door->lock();
MockSleepStrategy mockSleep;
Timer timer(&mockSleep);

EXPECT_CALL(mockSleep, sleep(_)).Times(1);
Timer timer;
EXPECT_CALL(mockClient, Timeout()).Times(0);

timer.tregister(1, &mockClient);
Expand Down

0 comments on commit a3ea5c4

Please sign in to comment.