Skip to content

Commit 66d2dce

Browse files
author
Michael Blome
committed
formatting
1 parent 967d584 commit 66d2dce

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

docs/test/writing-unit-tests-for-c-cpp.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,14 @@ TEST_CLASS and TEST_METHOD are part of the [Microsoft Native Test Framework](mic
7878
A TEST_METHOD returns void. To produce a test result, use the static methods in the `Assert` class to test actual results against what is expected. In the following example, assume `MyClass` has a constructor that takes a `std::string`. We can test that the constructor initializes the class as expected like so:
7979

8080
```cpp
81-
TEST_METHOD(TestClassInit)
82-
{
83-
std::string name = "Bill";
84-
MyClass mc(name);
85-
Assert::AreEqual(name, mc.GetName());
86-
}
81+
TEST_METHOD(TestClassInit)
82+
{
83+
std::string name = "Bill";
84+
MyClass mc(name);
85+
Assert::AreEqual(name, mc.GetName());
86+
}
8787
```
88+
8889
In the previous example, the result of the `Assert::AreEqual` call determines whether the test passes or fails. The Assert class contains many other methods for comparing expected vs. actual results.
8990
9091
You can add *traits* to test methods to specify test owners, priority and other information. You can then use these values to sort and group tests in **Test Explorer**. For more information, see [Run unit tests with Test Explorer](run-unit-tests-with-test-explorer.md).
@@ -125,10 +126,8 @@ After **CodeLens** is initialized, you can see test status icons above each unit
125126
126127
Click on the icon for more information, or to run or debug the unit test:
127128
128-
![C++ CodeLens Run and Debug](media/cpp-test-codelens-run-debug.png)
129-
129+
![C++ CodeLens Run and Debug](media/cpp-test-codelens-run-debug.png)
130130
131-
132131
## See also
133132
134133
[Unit test your code](unit-test-your-code.md)

0 commit comments

Comments
 (0)