mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-18 21:12:25 +02:00
Added a failng test
This commit is contained in:
42
JsonGeneratorTests/JsonObject_Indexer_Tests.cpp
Normal file
42
JsonGeneratorTests/JsonObject_Indexer_Tests.cpp
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Arduino JSON library
|
||||
* Benoit Blanchon 2014 - MIT License
|
||||
*/
|
||||
|
||||
#include "CppUnitTest.h"
|
||||
#include "JsonArray.h"
|
||||
#include "JsonObject.h"
|
||||
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
using namespace ArduinoJson::Generator;
|
||||
|
||||
namespace JsonGeneratorTests
|
||||
{
|
||||
TEST_CLASS(JsonObject_Indexer_Tests)
|
||||
{
|
||||
JsonObject<2> object;
|
||||
|
||||
public:
|
||||
|
||||
/* TEST_METHOD(Empty)
|
||||
{
|
||||
mustNotContain("key");
|
||||
}*/
|
||||
|
||||
TEST_METHOD(OneString)
|
||||
{
|
||||
object["key"] = "value";
|
||||
|
||||
mustContain("key", "value");
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
void mustContain(const char* key, const char* expected)
|
||||
{
|
||||
auto actual = (const char*) object[key];
|
||||
Assert::AreEqual(expected, actual);
|
||||
}
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user