mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-18 04:52:22 +02:00
Added a test class for StringBuilder
This commit is contained in:
32
JsonGeneratorTests/StringBuilderTests.cpp
Normal file
32
JsonGeneratorTests/StringBuilderTests.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
#include "CppUnitTest.h"
|
||||
#include "StringBuilder.h"
|
||||
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
|
||||
namespace JsonGeneratorTests
|
||||
{
|
||||
TEST_CLASS(StringBuilderTests)
|
||||
{
|
||||
char buffer[16];
|
||||
StringBuilder* sb;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
TEST_METHOD_INITIALIZE(Initialize)
|
||||
{
|
||||
sb = new StringBuilder(buffer, sizeof(buffer));
|
||||
}
|
||||
|
||||
TEST_METHOD(InitialState)
|
||||
{
|
||||
assertResultIs("");
|
||||
}
|
||||
|
||||
|
||||
void assertResultIs(const char* expected)
|
||||
{
|
||||
Assert::AreEqual(expected, buffer);
|
||||
}
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user