Skip to content

Commit 22980bf

Browse files
committed
[Testing] add comments to c++ example
1 parent 7609ffd commit 22980bf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

technical/automated_testing.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,21 @@ of the code (though sometimes that "functionality" is encompassed by multiple fu
105105
themselves be "under test" it is critical that they be as short, simple, and self-explanatory as possible. A common idiom to use is "Arrange-Act-Assert", which in our test
106106
framework looks like this:
107107
```c++
108+
// ??? App/AppTests/MappedNamePOSTFIXTEST.cpp ???
109+
// TEST(ClassName, methodName)
108110
TEST(MappedName, toConstString)
109111
{
110112
// Arrange
113+
// create a MappedName instance and a size variable
111114
Data::MappedName mappedName(Data::MappedName("TEST"), "POSTFIXTEST");
112115
int size {0};
113116

114117
// Act
118+
// invoke the method
115119
const char* temp = mappedName.toConstString(0, size);
116120

117121
// Assert
122+
// compare the actual result to expected results
118123
EXPECT_EQ(QByteArray(temp, size), QByteArray("TEST"));
119124
EXPECT_EQ(size, 4);
120125
}

0 commit comments

Comments
 (0)