Renamed private method

This commit is contained in:
Benoît Blanchon
2014-07-03 12:41:22 +02:00
parent 9bcb5610e8
commit 4d4d775e7a
2 changed files with 27 additions and 27 deletions

View File

@ -15,7 +15,7 @@ namespace JsonGeneratorTests
TEST_METHOD(Empty) TEST_METHOD(Empty)
{ {
returns(2); returnValueIs(2);
jsonIs("[]"); jsonIs("[]");
} }
@ -23,7 +23,7 @@ namespace JsonGeneratorTests
{ {
addValue((char*)0); addValue((char*)0);
returns(6); returnValueIs(6);
jsonIs("[null]"); jsonIs("[null]");
} }
@ -31,7 +31,7 @@ namespace JsonGeneratorTests
{ {
addValue("hello"); addValue("hello");
returns(9); returnValueIs(9);
jsonIs("[\"hello\"]"); jsonIs("[\"hello\"]");
} }
@ -40,7 +40,7 @@ namespace JsonGeneratorTests
addValue("hello"); addValue("hello");
addValue("world"); addValue("world");
returns(17); returnValueIs(17);
jsonIs("[\"hello\",\"world\"]"); jsonIs("[\"hello\",\"world\"]");
} }
@ -50,7 +50,7 @@ namespace JsonGeneratorTests
addValue("world"); addValue("world");
addValue("lost"); addValue("lost");
returns(17); returnValueIs(17);
jsonIs("[\"hello\",\"world\"]"); jsonIs("[\"hello\",\"world\"]");
} }
@ -58,7 +58,7 @@ namespace JsonGeneratorTests
{ {
addValue(3.14); addValue(3.14);
returns(6); returnValueIs(6);
jsonIs("[3.14]"); jsonIs("[3.14]");
} }
@ -67,7 +67,7 @@ namespace JsonGeneratorTests
addValue(3.14); addValue(3.14);
addValue(2.72); addValue(2.72);
returns(11); returnValueIs(11);
jsonIs("[3.14,2.72]"); jsonIs("[3.14,2.72]");
} }
@ -77,7 +77,7 @@ namespace JsonGeneratorTests
addValue(2.72); addValue(2.72);
addValue(1.41); addValue(1.41);
returns(11); returnValueIs(11);
jsonIs("[3.14,2.72]"); jsonIs("[3.14,2.72]");
} }
@ -85,7 +85,7 @@ namespace JsonGeneratorTests
{ {
addValue(true); addValue(true);
returns(6); returnValueIs(6);
jsonIs("[true]"); jsonIs("[true]");
} }
@ -93,7 +93,7 @@ namespace JsonGeneratorTests
{ {
addValue(false); addValue(false);
returns(7); returnValueIs(7);
jsonIs("[false]"); jsonIs("[false]");
} }
@ -102,7 +102,7 @@ namespace JsonGeneratorTests
addValue(false); addValue(false);
addValue(true); addValue(true);
returns(12); returnValueIs(12);
jsonIs("[false,true]"); jsonIs("[false,true]");
} }
@ -112,7 +112,7 @@ namespace JsonGeneratorTests
addValue(true); addValue(true);
addValue(false); addValue(false);
returns(12); returnValueIs(12);
jsonIs("[false,true]"); jsonIs("[false,true]");
} }
@ -122,7 +122,7 @@ namespace JsonGeneratorTests
addNested(nestedArray); addNested(nestedArray);
returns(4); returnValueIs(4);
jsonIs("[[]]"); jsonIs("[[]]");
} }
@ -132,7 +132,7 @@ namespace JsonGeneratorTests
addNested(nestedHash); addNested(nestedHash);
returns(4); returnValueIs(4);
jsonIs("[{}]"); jsonIs("[{}]");
} }
@ -143,7 +143,7 @@ namespace JsonGeneratorTests
addNested(nestedArray); addNested(nestedArray);
returns(8); returnValueIs(8);
jsonIs("[[3.14]]"); jsonIs("[[3.14]]");
} }
@ -166,7 +166,7 @@ namespace JsonGeneratorTests
Assert::AreEqual(expected, buffer); Assert::AreEqual(expected, buffer);
} }
void returns(size_t expected) void returnValueIs(size_t expected)
{ {
size_t actual = arr.printTo(buffer, sizeof(buffer)); size_t actual = arr.printTo(buffer, sizeof(buffer));
Assert::AreEqual(expected, actual); Assert::AreEqual(expected, actual);

View File

@ -15,7 +15,7 @@ namespace JsonGeneratorTests
TEST_METHOD(Empty) TEST_METHOD(Empty)
{ {
returns(2); returnValueIs(2);
jsonIs("{}"); jsonIs("{}");
} }
@ -23,7 +23,7 @@ namespace JsonGeneratorTests
{ {
addValue("key", "value"); addValue("key", "value");
returns(15); returnValueIs(15);
jsonIs("{\"key\":\"value\"}"); jsonIs("{\"key\":\"value\"}");
} }
@ -32,7 +32,7 @@ namespace JsonGeneratorTests
addValue("key1", "value1"); addValue("key1", "value1");
addValue("key2", "value2"); addValue("key2", "value2");
returns(33); returnValueIs(33);
jsonIs("{\"key1\":\"value1\",\"key2\":\"value2\"}"); jsonIs("{\"key1\":\"value1\",\"key2\":\"value2\"}");
} }
@ -42,7 +42,7 @@ namespace JsonGeneratorTests
addValue("key2", "value2"); addValue("key2", "value2");
addValue("key3", "value3"); addValue("key3", "value3");
returns(33); returnValueIs(33);
jsonIs("{\"key1\":\"value1\",\"key2\":\"value2\"}"); jsonIs("{\"key1\":\"value1\",\"key2\":\"value2\"}");
} }
@ -50,7 +50,7 @@ namespace JsonGeneratorTests
{ {
addValue("pi", 3.14); addValue("pi", 3.14);
returns(11); returnValueIs(11);
jsonIs("{\"pi\":3.14}"); jsonIs("{\"pi\":3.14}");
} }
@ -58,7 +58,7 @@ namespace JsonGeneratorTests
{ {
addValue("key", (char*) 0); addValue("key", (char*) 0);
returns(12); returnValueIs(12);
jsonIs("{\"key\":null}"); jsonIs("{\"key\":null}");
} }
@ -66,7 +66,7 @@ namespace JsonGeneratorTests
{ {
addValue("key", true); addValue("key", true);
returns(12); returnValueIs(12);
jsonIs("{\"key\":true}"); jsonIs("{\"key\":true}");
} }
@ -74,7 +74,7 @@ namespace JsonGeneratorTests
{ {
addValue("key", false); addValue("key", false);
returns(13); returnValueIs(13);
jsonIs("{\"key\":false}"); jsonIs("{\"key\":false}");
} }
@ -83,7 +83,7 @@ namespace JsonGeneratorTests
JsonArray<1> nestedArray; JsonArray<1> nestedArray;
addNested("key", nestedArray); addNested("key", nestedArray);
returns(10); returnValueIs(10);
jsonIs("{\"key\":[]}"); jsonIs("{\"key\":[]}");
} }
@ -92,7 +92,7 @@ namespace JsonGeneratorTests
JsonHashTable<1> nestedHash; JsonHashTable<1> nestedHash;
addNested("key", nestedHash); addNested("key", nestedHash);
returns(10); returnValueIs(10);
jsonIs("{\"key\":{}}"); jsonIs("{\"key\":{}}");
} }
@ -115,7 +115,7 @@ namespace JsonGeneratorTests
Assert::AreEqual(expected, buffer); Assert::AreEqual(expected, buffer);
} }
void returns(size_t expected) void returnValueIs(size_t expected)
{ {
size_t actual = hash.printTo(buffer, sizeof(buffer)); size_t actual = hash.printTo(buffer, sizeof(buffer));
Assert::AreEqual(expected, actual); Assert::AreEqual(expected, actual);