This repository has been archived by the owner on Jun 12, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from adamralph/25
#25 added step overloads with a step context parameter
- Loading branch information
Showing
18 changed files
with
618 additions
and
112 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
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
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
// <copyright file="IStepContext.cs" company="xBehave.net contributors"> | ||
// Copyright (c) xBehave.net contributors. All rights reserved. | ||
// </copyright> | ||
|
||
namespace Xbehave | ||
{ | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary> | ||
/// A scenario step context. | ||
/// </summary> | ||
public interface IStepContext | ||
{ | ||
/// <summary> | ||
/// Immediately registers the <see cref="IDisposable"/> object for disposal after all steps in the current scenario have been executed. | ||
/// </summary> | ||
/// <param name="disposable">The object to be disposed.</param> | ||
/// <returns>The current <see cref="IStepContext"/>.</returns> | ||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Using", Justification = "Makes sense here.")] | ||
IStepContext Using(IDisposable disposable); | ||
} | ||
} |
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,26 @@ | ||
// <copyright file="StepContext.cs" company="xBehave.net contributors"> | ||
// Copyright (c) xBehave.net contributors. All rights reserved. | ||
// </copyright> | ||
|
||
namespace Xbehave | ||
{ | ||
using System; | ||
|
||
internal partial class StepContext : IStepContext | ||
{ | ||
private Sdk.Step step; | ||
|
||
public void Assign(Sdk.Step step) | ||
{ | ||
Guard.AgainstNullArgument("step", step); | ||
|
||
this.step = step; | ||
} | ||
|
||
public IStepContext Using(IDisposable disposable) | ||
{ | ||
this.step.AddDisposable(disposable); | ||
return this; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.