|
| 1 | +/* |
| 2 | + Copyright (c) 2021 Arduino. All rights reserved. |
| 3 | +*/ |
| 4 | + |
| 5 | +/************************************************************************************** |
| 6 | + INCLUDE |
| 7 | + **************************************************************************************/ |
| 8 | + |
| 9 | +#include <catch.hpp> |
| 10 | + |
| 11 | +#include <property/types/CloudScheduler.h> |
| 12 | + |
| 13 | +unsigned long time_now = 1; |
| 14 | + |
| 15 | +/************************************************************************************** |
| 16 | + * TimeService Fake CTOR/DTOR |
| 17 | + **************************************************************************************/ |
| 18 | + |
| 19 | +TimeService::TimeService() {} |
| 20 | + |
| 21 | +/************************************************************************************** |
| 22 | + * TimeService Fake Methods |
| 23 | + **************************************************************************************/ |
| 24 | + |
| 25 | +unsigned long TimeService::getTime() {return time_now;} |
| 26 | + |
| 27 | +/************************************************************************************** |
| 28 | + TEST CODE |
| 29 | + **************************************************************************************/ |
| 30 | + |
| 31 | +SCENARIO("Tesing cloud type 'Scheduler' Ctor", "[Scheduler::Scheduler]") |
| 32 | +{ |
| 33 | + WHEN("A Scheduler(0,0,0,0,0) is being instantiated") |
| 34 | + { |
| 35 | + Scheduler schedule(0,0,0,0,0); |
| 36 | + THEN("The member variable 'start' should be 0") { |
| 37 | + REQUIRE(schedule.start == 0); |
| 38 | + } |
| 39 | + THEN("The member variable 'end' should be 0") { |
| 40 | + REQUIRE(schedule.end == 0); |
| 41 | + } |
| 42 | + THEN("The member variable 'duration' should be 0") { |
| 43 | + REQUIRE(schedule.duration == 0); |
| 44 | + } |
| 45 | + THEN("The member variable 'type' should be 0") { |
| 46 | + REQUIRE(schedule.type == 0); |
| 47 | + } |
| 48 | + THEN("The member variable 'mask' should be 0") { |
| 49 | + REQUIRE(schedule.mask == 0); |
| 50 | + } |
| 51 | + } |
| 52 | +} |
| 53 | + |
0 commit comments