Skip to content

Commit 963e47c

Browse files
authored
Update README.md
1 parent 0b0cf22 commit 963e47c

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,66 @@ In short, the attribute `CombinatorialData` must be added along with `TestMethod
2121
- `enum`: The values as returned by `Enum.GetNames`
2222
- `Nullable<T>`: The possible values of `T` plus the `null` value.
2323
- Otherwise, an exception is thrown.
24+
25+
More complete minimized example:
26+
27+
```csharp
28+
using System.Collections.Concurrent;
29+
using Combinatorial.MSTest;
30+
31+
namespace YourAssembly.Tests;
32+
33+
[TestClass]
34+
public class YourClassTests
35+
{
36+
[TestMethod]
37+
[CombinatorialData]
38+
public void Test1(
39+
[CombinatorialValues("1", "2", "3")] string x,
40+
[CombinatorialValues("A", "B", "C", "D")] string y)
41+
{
42+
// This test is run with the following inputs:
43+
// x = "1", y = "A"
44+
// x = "1", y = "B"
45+
// x = "1", y = "C"
46+
// x = "1", y = "D"
47+
// x = "2", y = "A"
48+
// x = "2", y = "B"
49+
// x = "2", y = "C"
50+
// x = "2", y = "D"
51+
// x = "3", y = "A"
52+
// x = "3", y = "B"
53+
// x = "3", y = "C"
54+
// x = "3", y = "D"
55+
}
56+
57+
[TestMethod]
58+
[CombinatorialData]
59+
public void Test2(
60+
bool x,
61+
bool? y)
62+
{
63+
// This test is run with the following inputs:
64+
// x = true, y = null
65+
// x = true, y = true
66+
// x = true, y = false
67+
// x = false, y = null
68+
// x = false, y = true
69+
// x = false, y = false
70+
}
71+
72+
[TestMethod]
73+
[CombinatorialData]
74+
public void Test3([CombinatorialRange(from: 0, count: 6)] int x)
75+
{
76+
// This test is run with x values from 0 to 5.
77+
}
78+
79+
[TestMethod]
80+
[CombinatorialData]
81+
public void Test4([CombinatorialRandomData(Count = 8)] int x)
82+
{
83+
// This test is run with 8 random integers.
84+
}
85+
}
86+
```

0 commit comments

Comments
 (0)