You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finish wiring up multiple return values using "BlockData" objects (#77)
* Finish wiring up multiple return values using "BlockData" objects
* Update README with test data and BlockData details
Co-authored-by: Kevin B <[email protected]>
* Finish requested changes to BlockData
---------
Co-authored-by: Kevin B <[email protected]>
Assert.Equal("Duplicate type found: Int32 appears multiple times. BlockData must use different types to avoid unexpected behavior by the TestCase DI Container.",
Assert.Equal("Duplicate type found: Int32 appears multiple times. BlockData must use different types to avoid unexpected behavior by the TestCase DI Container.",
Assert.Equal("Duplicate type found: Int32 appears multiple times. BlockData must use different types to avoid unexpected behavior by the TestCase DI Container.",
thrownewInvalidOperationException($"Duplicate type found: {type.Name} appears multiple times. BlockData must use different types to avoid unexpected behavior by the TestCase DI Container.");
Copy file name to clipboardExpand all lines: README.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,4 +120,15 @@ public async Task Test1()
120
120
121
121
Also note that current behavior is that TestFramework will take the result of the awaited test block task and use that for future test block dependencies. If you have a test block that returns Task<bool>, TestFramework will capture the bool result to use.
122
122
123
+
Test Data
124
+
-----
125
+
In normal situations, test blocks typically only return a single datapoint if any data is returned at all. The underlying container picks that object up and uses it for subsequent test blocks like demonstrated in the example project or unit tests. In some cases, it's not feasible to return just a single object, and so the BlockData object can handle returning 2 - 4 different data points. The execute method would look similar to this:
126
+
```
127
+
public BlockData<string, bool> Execute()
128
+
{
129
+
return new BlockData<string, bool>("Testing", true);
130
+
}
131
+
```
132
+
Note that in the out of the box BlockData objects, it will validate that the types are all unique; otherwise duplicate types would simply overwrite each other and cause unexpected behavior in subsquent block executions.
0 commit comments