-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt tests and project generation for .NET Core 3 (#1688)
* cleanup usings * reorder variable * rename and change values of TFM constants * rename constants to describe the value * cleanup file * update submodule * add test run combinations for .NET Core 3.0 * update build.yml to use .NET Core 3 preview 7 * use older NETCore 3 preview * add PowerShell task to output dotnet --info * add global.json to solution for using NETCoreSdk3 * add netcoreapp3.0 as TFM for unit tests * update submodule * split up named attribute values collection * fix crlf * update submodule * add SpecFlowAttributesFilter * use SpecFlowAttributesFilter * update submodule * update submodule to master * remove running tests for netcoreapp2.0
- Loading branch information
1 parent
57de28c
commit f26c4c8
Showing
16 changed files
with
315 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule SpecFlow.TestProjectGenerator
updated
from d071c7 to e4a555
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,127 +1,127 @@ | ||
using System; | ||
using TechTalk.SpecFlow.Bindings; | ||
|
||
namespace TechTalk.SpecFlow | ||
{ | ||
/// <summary> | ||
/// Marker attribute that specifies that this class may contain bindings (step definitions, hooks, etc.) | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] | ||
public class BindingAttribute : Attribute | ||
{ | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] | ||
public abstract class StepDefinitionBaseAttribute : Attribute | ||
{ | ||
internal StepDefinitionType[] Types { get; private set; } | ||
public string Regex { get; set; } | ||
|
||
using System; | ||
using TechTalk.SpecFlow.Bindings; | ||
|
||
namespace TechTalk.SpecFlow | ||
{ | ||
/// <summary> | ||
/// Marker attribute that specifies that this class may contain bindings (step definitions, hooks, etc.) | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] | ||
public class BindingAttribute : Attribute | ||
{ | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] | ||
public abstract class StepDefinitionBaseAttribute : Attribute | ||
{ | ||
internal StepDefinitionType[] Types { get; private set; } | ||
public string Regex { get; set; } | ||
|
||
/// <summary> | ||
/// additional information in which culture the step is written | ||
/// it does not affect the matching of the step | ||
/// it is only for tooling support needed | ||
/// </summary> | ||
public string Culture { get; set; } | ||
|
||
internal StepDefinitionBaseAttribute(string regex, StepDefinitionType type) | ||
: this(regex, new[] { type }) | ||
{ | ||
} | ||
|
||
protected StepDefinitionBaseAttribute(string regex, StepDefinitionType[] types) | ||
{ | ||
if (types == null) throw new ArgumentNullException("types"); | ||
if (types.Length == 0) throw new ArgumentException("List cannot be empty", "types"); | ||
|
||
Regex = regex; | ||
Types = types; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Specifies a 'Given' step definition that matches for the provided regular expression. | ||
/// </summary> | ||
public class GivenAttribute : StepDefinitionBaseAttribute | ||
{ | ||
public GivenAttribute() : this(null) | ||
{ | ||
} | ||
|
||
|
||
public GivenAttribute(string regex) | ||
: base(regex, StepDefinitionType.Given) | ||
{ | ||
} | ||
|
||
/// </summary> | ||
public string Culture { get; set; } | ||
|
||
internal StepDefinitionBaseAttribute(string regex, StepDefinitionType type) | ||
: this(regex, new[] { type }) | ||
{ | ||
} | ||
|
||
protected StepDefinitionBaseAttribute(string regex, StepDefinitionType[] types) | ||
{ | ||
if (types == null) throw new ArgumentNullException("types"); | ||
if (types.Length == 0) throw new ArgumentException("List cannot be empty", "types"); | ||
|
||
Regex = regex; | ||
Types = types; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Specifies a 'Given' step definition that matches for the provided regular expression. | ||
/// </summary> | ||
public class GivenAttribute : StepDefinitionBaseAttribute | ||
{ | ||
public GivenAttribute() : this(null) | ||
{ | ||
} | ||
|
||
|
||
public GivenAttribute(string regex) | ||
: base(regex, StepDefinitionType.Given) | ||
{ | ||
} | ||
|
||
public GivenAttribute(string regex, string culture) | ||
: this(regex) | ||
{ | ||
Culture = culture; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Specifies a 'When' step definition that matches for the provided regular expression. | ||
/// </summary> | ||
public class WhenAttribute : StepDefinitionBaseAttribute | ||
{ | ||
public WhenAttribute() : this(null) | ||
{ | ||
} | ||
|
||
public WhenAttribute(string regex) | ||
: base(regex, StepDefinitionType.When) | ||
{ | ||
} | ||
|
||
: this(regex) | ||
{ | ||
Culture = culture; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Specifies a 'When' step definition that matches for the provided regular expression. | ||
/// </summary> | ||
public class WhenAttribute : StepDefinitionBaseAttribute | ||
{ | ||
public WhenAttribute() : this(null) | ||
{ | ||
} | ||
|
||
public WhenAttribute(string regex) | ||
: base(regex, StepDefinitionType.When) | ||
{ | ||
} | ||
|
||
public WhenAttribute(string regex, string culture) | ||
: this(regex) | ||
{ | ||
Culture = culture; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Specifies a 'Then' step definition that matches for the provided regular expression. | ||
/// </summary> | ||
public class ThenAttribute : StepDefinitionBaseAttribute | ||
{ | ||
public ThenAttribute() : this(null) | ||
{ | ||
} | ||
|
||
public ThenAttribute(string regex) | ||
: base(regex, StepDefinitionType.Then) | ||
{ | ||
: this(regex) | ||
{ | ||
Culture = culture; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Specifies a 'Then' step definition that matches for the provided regular expression. | ||
/// </summary> | ||
public class ThenAttribute : StepDefinitionBaseAttribute | ||
{ | ||
public ThenAttribute() : this(null) | ||
{ | ||
} | ||
|
||
public ThenAttribute(string regex) | ||
: base(regex, StepDefinitionType.Then) | ||
{ | ||
} | ||
|
||
public ThenAttribute(string regex, string culture) | ||
: this(regex) | ||
{ | ||
Culture = culture; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Specifies a step definition that matches for the provided regular expression and any step kinds (given, when, then). | ||
/// </summary> | ||
public class StepDefinitionAttribute : StepDefinitionBaseAttribute | ||
{ | ||
public StepDefinitionAttribute() | ||
: this(null) | ||
{ | ||
} | ||
|
||
public StepDefinitionAttribute(string regex) | ||
: base(regex, new[] { StepDefinitionType.Given, StepDefinitionType.When, StepDefinitionType.Then }) | ||
{ | ||
} | ||
|
||
: this(regex) | ||
{ | ||
Culture = culture; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Specifies a step definition that matches for the provided regular expression and any step kinds (given, when, then). | ||
/// </summary> | ||
public class StepDefinitionAttribute : StepDefinitionBaseAttribute | ||
{ | ||
public StepDefinitionAttribute() | ||
: this(null) | ||
{ | ||
} | ||
|
||
public StepDefinitionAttribute(string regex) | ||
: base(regex, new[] { StepDefinitionType.Given, StepDefinitionType.When, StepDefinitionType.Then }) | ||
{ | ||
} | ||
|
||
public StepDefinitionAttribute(string regex, string culture) | ||
: this(regex) | ||
{ | ||
Culture = culture; | ||
} | ||
} | ||
: this(regex) | ||
{ | ||
Culture = culture; | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
TechTalk.SpecFlow/Bindings/Discovery/ISpecFlowAttributesFilter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace TechTalk.SpecFlow.Bindings.Discovery | ||
{ | ||
public interface ISpecFlowAttributesFilter | ||
{ | ||
IEnumerable<Attribute> FilterForSpecFlowAttributes(IEnumerable<Attribute> customAttributes); | ||
} | ||
} |
Oops, something went wrong.