Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

[1.10.0] - 2022-05-16
[1.10.2] - 2022-05-16
### Added
- Added cells representation to the ITableRowWrapper interface.
- Fixed NullReferenceException when using ComplexBindingBuilder in hooks
2 changes: 1 addition & 1 deletion src/Behavioral.Automation/Behavioral.Automation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The whole automation code is divided into the following parts:
- UI structure descriptive code
- Supportive code</Description>
<Copyright>Quantori Inc.</Copyright>
<PackageVersion>1.10.1</PackageVersion>
<PackageVersion>1.10.2</PackageVersion>
<RepositoryUrl>https://github.com/quantori/Behavioral.Automation</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
Expand Down
16 changes: 14 additions & 2 deletions src/Behavioral.Automation/Services/ComplexBindingBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void BuildAction<T1, T2, T3, T4>(Action<T1, T2, T3, T4> method, params ob

private void BuildAction(object[] pars, IEnumerable<StepDefinitionBaseAttribute> attributes, string methodName)
{
var definitionType = _scenarioContext.StepContext.StepInfo.StepDefinitionType.ToString();
var definitionType = GetStepDefinitionType().ToString();
var attributeForCurrentStep = attributes.FirstOrDefault(a => a.GetType().Name.StartsWith(definitionType, StringComparison.OrdinalIgnoreCase));
if (attributeForCurrentStep == null)
{
Expand All @@ -99,7 +99,7 @@ private void BuildAction(object[] pars, IEnumerable<StepDefinitionBaseAttribute>

private void RunAction(string stepExpression)
{
switch (_scenarioContext.StepContext.StepInfo.StepDefinitionType)
switch (GetStepDefinitionType())
{
case StepDefinitionType.Given:
_runner.Given(stepExpression);
Expand All @@ -115,6 +115,18 @@ private void RunAction(string stepExpression)
}
}

private StepDefinitionType GetStepDefinitionType()
{
try
{
return _scenarioContext.StepContext.StepInfo.StepDefinitionType;
}
catch (NullReferenceException)
{
return StepDefinitionType.Given;
}
}

private void RunAction(string stepExpression, Table table)
{
switch (_scenarioContext.StepContext.StepInfo.StepDefinitionType)
Expand Down