Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a0fb16f
commit 017cb85
Showing
12 changed files
with
862 additions
and
19 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...tack.BDDfy.Tests/Scanner/Examples/ExampleActionTests.CanUseActionsInExamples.approved.txt
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,11 @@ | ||
| ||
Scenario: Can use actions in examples | ||
Given some setup | ||
When <Action to perform> | ||
Then should be <Value should be> | ||
|
||
Examples: | ||
| Action to perform | Value should be | | ||
| Do something | 42 | | ||
| Do something else | 7 | | ||
|
44 changes: 44 additions & 0 deletions
44
TestStack.BDDfy.Tests/Scanner/Examples/ExampleActionTests.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,44 @@ | ||
using ApprovalTests; | ||
using NUnit.Framework; | ||
using Shouldly; | ||
using TestStack.BDDfy.Reporters; | ||
|
||
namespace TestStack.BDDfy.Tests.Scanner.Examples | ||
{ | ||
[TestFixture] | ||
public class ExampleActionTests | ||
{ | ||
private int value; | ||
|
||
[Test] | ||
public void CanUseActionsInExamples() | ||
{ | ||
ExampleAction actionToPerform = null; | ||
int valueShouldBe = 0; | ||
var story = this.Given(_ => SomeSetup()) | ||
.When(() => actionToPerform) | ||
.Then(_ => ShouldBe(valueShouldBe)) | ||
.WithExamples(new ExampleTable("Action to perform", "Value should be") | ||
{ | ||
{ new ExampleAction("Do something", () => { value = 42; }), 42 }, | ||
{ new ExampleAction("Do something else", () => { value = 7; }), 7 } | ||
}) | ||
.BDDfy(); | ||
|
||
|
||
var textReporter = new TextReporter(); | ||
textReporter.Process(story); | ||
Approvals.Verify(textReporter.ToString()); | ||
} | ||
|
||
private void ShouldBe(int i) | ||
{ | ||
value.ShouldBe(i); | ||
} | ||
|
||
private void SomeSetup() | ||
{ | ||
|
||
} | ||
} | ||
} |
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,2 +1,3 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=TestStack_002EBDDfy_002EAnnotations/@EntryIndexedValue">True</s:Boolean> | ||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CheckNamespace/@EntryIndexedValue">DO_NOT_SHOW</s:String></wpf:ResourceDictionary> |
Oops, something went wrong.