|
| 1 | +/* |
| 2 | + * Copyright (c) 2020 Arduino. All rights reserved. |
| 3 | +*/ |
| 4 | + |
| 5 | +/************************************************************************************** |
| 6 | + * INCLUDE |
| 7 | + **************************************************************************************/ |
| 8 | + |
| 9 | +#include<catch.hpp> |
| 10 | + |
| 11 | +#include<MillisFake.h> |
| 12 | +#include<StreamMock.h> |
| 13 | +#include<iostream> |
| 14 | +/************************************************************************************** |
| 15 | + * TEST CODE |
| 16 | + **************************************************************************************/ |
| 17 | + |
| 18 | +TEST_CASE ("Testing 'readString' with data available within the stream","[Stream-readString-01]") |
| 19 | +{ |
| 20 | + StreamMock mock; |
| 21 | + mock.setTimeout(10); |
| 22 | +millis_autoOn(); |
| 23 | + mock <<"This is test stream content"; |
| 24 | + |
| 25 | +REQUIRE(mock.readString() ==arduino::String("This is test stream content")); |
| 26 | +} |