forked from bblanchon/ArduinoJson
Added JsonArrayIterator (tests are failing)
This commit is contained in:
31
JsonParserTests/JsonArrayIteratorTests.cpp
Normal file
31
JsonParserTests/JsonArrayIteratorTests.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
#include "CppUnitTest.h"
|
||||
#include "JsonParser.h"
|
||||
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
using namespace ArduinoJson::Parser;
|
||||
|
||||
|
||||
namespace JsonParserTests
|
||||
{
|
||||
TEST_CLASS(JsonArrayIteratorTests)
|
||||
{
|
||||
public:
|
||||
|
||||
TEST_METHOD(TestMethod1)
|
||||
{
|
||||
char json [] = "[1,2,3]";
|
||||
JsonParser<4> parser;
|
||||
|
||||
JsonArray a = parser.parse(json);
|
||||
|
||||
long expected = 1;
|
||||
|
||||
for (auto i : a)
|
||||
{
|
||||
Assert::AreEqual(expected, (long)*i);
|
||||
expected++;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user