-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathMsTestGenerationTest.cs
47 lines (42 loc) · 1.48 KB
/
MsTestGenerationTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Reqnroll.TestProjectGenerator;
namespace Reqnroll.SystemTests.Generation;
/// <summary>
/// The purpose of these tests to verify that the tests generated by the
/// MsTest generator compile and can execute with MsTest.
/// </summary>
[TestClass]
[TestCategory("MsTest")]
public class MsTestGenerationTest : GenerationTestBase
{
protected override void TestInitialize()
{
base.TestInitialize();
_testRunConfiguration.UnitTestProvider = UnitTestProvider.MSTest;
}
/// <summary>
/// MsTest v2.* defines the [DataRow] attribute with a ctor that cannot handle if the second
/// parameter of the attribute is a string[]. This causes problems with single-column examples,
/// because in this case the second parameter is a list of example block tags passed in as string[].
/// </summary>
[TestMethod]
public void Generator_handles_tagged_examples_block_with_single_column()
{
AddScenario(
"""
Scenario Outline: Sample Scenario Outline
When <what> happens
@example_tag
Examples:
| what |
| foo |
| bar |
Examples: Second example without tags - in this case the tag list is null.
| what |
| baz |
""");
_projectsDriver.AddPassingStepBinding();
ExecuteTests();
ShouldAllScenariosPass(3);
}
}