Commits

Matt Oswald committed de69e6e

updating docs for the new test names being strings

Comments (0)

Files changed (5)

    return x * x;
 }
 
-FACT(DoublingTwoReturnsFour)
+FACT("Doubling 2 returns 4")
 {
    auto expected = 4;
    Assert.Equal(expected, Double(2));
 {{{
 #!c++
 
-FACT(DoublingOneReturnsTwo)
+FACT("Doubling 1 returns 2")
 {
    auto expected = 2;
    Assert.Equal(expected, Double(1));
 }
 
-FACT(DoublingNegativeOneReturnsNegativeTwo)
+FACT("Doubling -1 returns -2")
 {
    auto expected = -2;
    Assert.Equal(expected, Double(-1));
    return x * x;
 }
 
-THEORY(DoubleTest, (int expected, int value),
+THEORY("Double Test", (int expected, int value),
    std::make_tuple(2, 1),
    std::make_tuple(4, 2),
    std::make_tuple(-2, -1),
 std::function<std::vector<std::tuple<int, int>>()> stdFn = ...;
 
 // or even a lambda! (note the parens around the lambda)
-DATA_THEORY(LambdaTheory, (int expected, int value),
+DATA_THEORY("Lambda Theory", (int expected, int value),
 ([]() -> std::vector<std::tuple<int, int>>
 {
    std::vector<std::tuple<int, int>> data;

InstallAndSetup.wiki

 ----
 ===== Visual Studio =====
 
-Regardless of the path taken to add xUnit++ to your project, you can install the [[http://visualstudiogallery.msdn.microsoft.com/3503c205-256e-4b22-b99b-13aaf257c67a|xUnit++ Visual Studio Test Adapter]]. This will automatically discover and run your tests for you using the built-in Text Execution Window.
+Regardless of the path taken to add xUnit++ to your project, you can install the [[http://visualstudiogallery.msdn.microsoft.com/3503c205-256e-4b22-b99b-13aaf257c67a|xUnit++ Visual Studio Test Adapter]] (coming soon). This will automatically discover and run your tests for you using the built-in Text Execution Window.

RunningTests.wiki

 
 ===== Visual Studio Test Adapter =====
 
-You can install the [[http://visualstudiogallery.msdn.microsoft.com/3503c205-256e-4b22-b99b-13aaf257c67a|xUnit++ Visual Studio Test Adapter]]. This will automatically discover and run your tests for you using the built-in Text Execution Window.
+You can install the [[http://visualstudiogallery.msdn.microsoft.com/3503c205-256e-4b22-b99b-13aaf257c67a|xUnit++ Visual Studio Test Adapter]] (coming soon). This will automatically discover and run your tests for you using the built-in Text Execution Window.

SuitesAndAttributes.wiki

 
 {{{
 #!c++
-SUITE(SomeSuite)
+SUITE("Some Suite")
 {
 
-FACT(SomeFact)
+FACT("Some Fact")
 {
 }
 
 
 == Attributes ==
 
-Attributes are a much more fine-grained method of grouping tests. Every test (whether within a suite or not) can be decorated with up to eight key-value pair attributes:
+Attributes are a much more fine-grained method of grouping tests. Every test (whether within a suite or not) can be decorated with up to eight key-value pair attributes, by wrapping the test(s) in an {{{ATTRIBUTES}}} block:
 
 {{{
 #!c++
-ATTRIBUTES(TestName, ("Category", "Server"))
-FACT(TestName)
+ATTRIBUTES(("Category", "Server"))
 {
-    // do some work that apparently fits in a "Server" category
+
+FACT("Fact 1")
+{
+    // test some work that apparently fits in a "Server" category
+}
+
+FACT("Fact 2")
+{
+    // test some work that apparently fits in a "Server" category
+}
+
 }
 }}}
 
 
 {{{
 #!c++
-ATTRIBUTES(TestName, ("Skip", "Takes way too long to complete. Need to refactor"))
+ATTRIBUTES(("Skip", "Takes way too long to complete. Need to refactor"))
+{
+
 TIMED_FACT(TestName, 0)
 {
     // do some long-running work that makes the test process take too long:
     std::this_thread::sleep_for(std::chrono::seconds(10));
 }
+
+}
 }}}
 
 Importantly, skipped tests will never be instantiated, so no long-running fixture or theory setup will be run.
 
 {{{
 #!c++
-FACT(WidgetDefaultConstructorDestructorNeverThrows)
+FACT("Widget default Constructor and Destructor will never throw")
 {
     Assert.DoesNotThrow([]() { Widget w; });
 }
     int someData;
 };
 
-FACT_FIXTURE(MyTest, MyFixture)
+FACT_FIXTURE("My Test", MyFixture)
 {
     int temp = someData;
 }
 
 {{{
 #!c++
-TIMED_FACT(ShortTest, 5)
+TIMED_FACT("Quick Test", 5)
 {
     // test code that must complete within 5 milliseconds
 }
 
 {{{
 #!c++
-THEORY(WidgetDestructorNeverThrows, (Widget *w),
+THEORY("Widget Destructor should never throw", (Widget *w),
     std::make_tuple(new Widget((int)0)),
     std::make_tuple(new Widget(new Foo())),
     std::make_tuple(new Widget(nullptr))
     return data;
 }
 
-DATA_THEORY(WidgetConstructorsAndDestructorNeverThrows, (std::function<void()> makeAndDestroyWidget), DataProvider)
+DATA_THEORY("The Widget Constructors and the Destructor will never throw", (std::function<void()> makeAndDestroyWidget), DataProvider)
 {
     Assert.DoesNotThrow(makeAndDestroyWidget);
 }
 
 ====== Test Timeouts ======
 
-A note on the test timeouts: this is inherently very fragile. Once a thread begins executing, there is no guarantee that the test will actually get //n// milliseconds of CPU time. It's possible that other tests or system processes will take control of the CPU for the majority of the time, leaving the watchdog timeout thread no choice but to assume the test thread failed to complete within the allotted time.
+A note on the test timeouts: this is inherently very fragile. Once a thread begins executing, there is no guarantee that the test will actually get //n// milliseconds of CPU time. It's possible that other tests or system processes will take control of the CPU for the majority of the time, leaving the watchdog timeout thread no choice but to assume the test thread failed to complete within the allotted time.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.