Skip to content

Commit

Permalink
Merge pull request #462 from BlueDotBrigade/Features/191-GherkinScena…
Browse files Browse the repository at this point in the history
…rios

Merge `Features/191` to main for: Gherkinn scenarios
  • Loading branch information
BlueDotBrigadeFounder authored Nov 21, 2024
2 parents 73b7301 + d59f40e commit 60dcf40
Show file tree
Hide file tree
Showing 27 changed files with 293 additions and 190 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@
<PackageReference Include="Cocona" Version="2.2.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Collections.Immutable">
<Version>8.0.0</Version>
<Version>9.0.0</Version>
</PackageReference>
<PackageReference Include="System.ComponentModel.Composition" Version="9.0.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />
<PackageReference Include="System.Collections.Immutable" Version="9.0.0" />
<PackageReference Include="Text.Analyzers" Version="3.11.0-beta1.23364.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
<None Remove="Resources\Images\Weevil.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NLog" Version="5.3.2" />
<PackageReference Include="System.ComponentModel.Composition" Version="8.0.0" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="System.ComponentModel.Composition" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BlueDotBrigade.Weevil.Common\BlueDotBrigade.Weevil.Common.csproj" />
Expand Down
3 changes: 0 additions & 3 deletions Src/BlueDotBrigade.Weevil.Core/Diagnostics/NLogWriter.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
namespace BlueDotBrigade.Weevil.Diagnostics
{
using System;
using System.Collections;
using System.Collections.Generic;
using NLog;
using NLog.Fluent;

/// <summary>
/// Represents an adapter that facilitates writing to NLog.
Expand Down
1 change: 1 addition & 0 deletions Src/BlueDotBrigade.Weevil.Core/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using NLog;
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,21 @@
<Version>13.0.3</Version>
</PackageReference>
<PackageReference Include="NLog">
<Version>5.3.2</Version>
<Version>5.3.4</Version>
</PackageReference>
<PackageReference Include="PostSharp">
<Version>2024.1.6</Version>
</PackageReference>
<PackageReference Include="PostSharp.Patterns.Model">
<Version>2024.1.6</Version>
</PackageReference>
<PackageReference Include="Prism.Core" Version="8.1.97" />
<PackageReference Include="Prism.Core" Version="9.0.537" />
<PackageReference Include="System.Collections.Immutable">
<Version>8.0.0</Version>
<Version>9.0.0</Version>
</PackageReference>
<PackageReference Include="System.ComponentModel.Composition" Version="9.0.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="System.Management" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BlueDotBrigade.Weevil.Common\BlueDotBrigade.Weevil.Common.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.3.4" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.6" />
<PackageReference Include="System.ComponentModel.Composition" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 14 additions & 0 deletions Src/BlueDotBrigade.Weevil.TestingTools/Text/RegexHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace BlueDotBrigade.Weevil.TestingTools.Text
{
public class RegexHelper
{
public static string RevealGroups(string pattern)
{
if (pattern.StartsWith("(") && pattern.EndsWith(")"))
{
pattern = pattern.Substring(1, pattern.Length - 2);
}
return pattern.Replace("(?:", "(");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<PackageReference Include="MSTest.TestFramework">
<Version>3.6.3</Version>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Src\BlueDotBrigade.Weevil.Common\BlueDotBrigade.Weevil.Common.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
<Compile Remove="OLD\RecordContentValidator.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
<PackageReference Include="BlueDotBrigade.DatenLokator" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="Reqnroll.MsTest" Version="2.2.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" Version="6.12.2" />
<PackageReference Include="System.ComponentModel.Composition" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Src\BlueDotBrigade.Weevil.Common\BlueDotBrigade.Weevil.Common.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: Filtering
Scenario: Logical OR operator used to define multiple expressions
Given that the default log file is open
When applying the include filter: Directives||Fatal
Then there will be 8 visible records
Then there will be 8 matching records
And each record will include either
"""
Directives
Expand All @@ -32,8 +32,8 @@ Scenario: Exclude filter hides records with specified terms
@Requirement:401
Scenario: Exclude filter overrides include filter when both are applied
Given that the default log file is open
When entering the include filter: Core
And entering the exclude filter: Debug
When using the include filter: Core
And using the exclude filter: Debug
And applying the filters
Then all records will include: Core
And all records will exclude: Debug
Expand All @@ -42,18 +42,18 @@ Scenario: Exclude filter overrides include filter when both are applied
Scenario: Pinned records remain visible regardless of active filters
Given that the default log file is open
When pinning the record on line 2
And pinning the record on line 4
And pinning the record on line 8
And applying the include filter: text not found
Then there will be 3 visible records
And line number 2 will be visible
And line number 4 will be visible
And line number 8 will be visible
And pinning the record on line 4
And pinning the record on line 8
And applying the include filter: text not found
Then there will be 3 matching records
And line number 2 will be visible
And line number 4 will be visible
And line number 8 will be visible

@Requirement:424
Scenario: Built-in filter alias #IPv6 identifies records with IP addresses
Given that the default log file is open
When using the "Regular Expression" filter mode
And applying the include filter: #IPV6
Then there will be 1 visible records
And all records will include: S/N=IA-1073R037
And applying the include filter: #IPV6
Then there will be 1 matching records
And all records will include: S/N=IA-1073R037
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ public FilteringSteps(Token token) : base(token)
}

/// <seealso cref="WhenApplyingTheIncludeFilter"/>
[When($"entering the include filter: {X.AnyText}")]
public void WhenEnteringTheIncludeFilter(string includeFilter)
[When($"using the include filter: {X.AnyText}")]
public void WhenUsingTheIncludeFilter(string includeFilter)
{
this.Context.IncludeFilter = includeFilter;
}

/// <seealso cref="WhenApplyingTheExcludeFilter"/>
[When($"entering the exclude filter: {X.AnyText}")]
public void WhenEnteringTheExcludeFilter(string excludeFilter)
[When($"using the exclude filter: {X.AnyText}")]
public void WhenUsingTheExcludeFilter(string excludeFilter)
{
this.Context.ExcludeFilter = excludeFilter;
}
Expand Down Expand Up @@ -62,8 +62,8 @@ public void WhenApplyingTheExcludeFilter(string excludeFilter)
this.Context.FilterCriteria);
}

[Then($@"there will be {X.RecordCount} visible records")]
public void ThenThereWillBeVisibleRecords(int recordCount)
[Then($@"there will be {X.Integer} matching records")]
public void ThenThereWillBeMatchingRecords(int recordCount)
{
this.Context.Results.Length
.Should()
Expand Down
2 changes: 1 addition & 1 deletion Tst/BlueDotBrigade.Weevil.Core-FeatureTests/X.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal sealed class X

public const string AnyText = @"(.*)";

public const string RecordCount = @"(\d+)";
public const string Integer = @"(\d+)";

public const string OnOff = @"(on|off)";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
<Compile Remove="OLD\RecordContentValidator.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
<PackageReference Include="BlueDotBrigade.DatenLokator" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" Version="6.12.2" />
<PackageReference Include="System.ComponentModel.Composition" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Src\BlueDotBrigade.Weevil.Common\BlueDotBrigade.Weevil.Common.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
global using FluentAssertions;
global using NLog;

global using FluentAssertions;

global using Microsoft.VisualStudio.TestTools.UnitTesting;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@
<PackageReference Include="BlueDotBrigade.DatenLokator">
<Version>2.0.0</Version>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.12.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="MSTest.TestAdapter">
<Version>3.6.3</Version>
</PackageReference>
<PackageReference Include="MSTest.TestFramework">
<Version>3.6.3</Version>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="System.ComponentModel.Composition" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Src\BlueDotBrigade.Weevil.Common\BlueDotBrigade.Weevil.Common.csproj" />
Expand Down
Loading

0 comments on commit 60dcf40

Please sign in to comment.