forked from johnnyb/Eventually
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9528c16
commit 0a3f2e4
Showing
7 changed files
with
67 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "main.h" | ||
|
||
EvtManager mgr; | ||
|
||
void setup() | ||
{ | ||
} | ||
|
||
void loop() | ||
{ | ||
mgr.loopIteration(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "Eventually.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include <ArduinoFake.h> | ||
#include <unity.h> | ||
|
||
#include "EvtManager.h" | ||
|
||
using namespace fakeit; | ||
|
||
EvtManager target; | ||
Mock<EvtListener> listenerMock; | ||
|
||
void setUp(void) | ||
{ | ||
When(Method(listenerMock, setupListener)).AlwaysReturn(); | ||
When(Method(listenerMock, isEventTriggered)).AlwaysReturn(true); | ||
When(Method(listenerMock, performTriggerAction)).AlwaysReturn(); | ||
} | ||
|
||
void tearDown(void) | ||
{ | ||
listenerMock.Reset(); | ||
} | ||
|
||
void test_default_to_one_context(void) | ||
{ | ||
EvtListener &listener = listenerMock.get(); | ||
target.addListener(&listener); | ||
target.loopIteration(); | ||
} | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
UNITY_BEGIN(); | ||
RUN_TEST(test_default_to_one_context); | ||
UNITY_END(); | ||
|
||
return 0; | ||
} |