Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gasparnagy committed Jan 24, 2024
1 parent 42be76d commit 55808f7
Show file tree
Hide file tree
Showing 47 changed files with 284 additions and 359 deletions.
21 changes: 0 additions & 21 deletions Installer/Reqnroll.NUnit.Runners/Reqnroll.NUnit.Runners.csproj

This file was deleted.

29 changes: 0 additions & 29 deletions Installer/Reqnroll.NUnit.Runners/Reqnroll.NUnit.Runners.nuspec

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using Reqnroll;

// ReSharper disable once CheckNamespace
namespace TechTalk.SpecFlow.Assist;

public static class InstanceComparisonExtensionMethods
{

public static void CompareToInstance<T>(this Table table, T instance)
{
Reqnroll.InstanceComparisonExtensionMethods.CompareToInstance(table, instance);
}

/// <summary>
/// Indicates whether the table is equivalent to the specified instance by comparing the values of all
/// columns against the properties of the instance. Will return false after finding the first difference.
/// </summary>
public static bool IsEquivalentToInstance<T>(this Table table, T instance)
{
return Reqnroll.InstanceComparisonExtensionMethods.IsEquivalentToInstance(table, instance)

Check failure on line 21 in Plugins/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin/Wrappers/InstanceComparisonExtensionMethods.cs

View workflow job for this annotation

GitHub Actions / build

; expected

Check failure on line 21 in Plugins/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin/Wrappers/InstanceComparisonExtensionMethods.cs

View workflow job for this annotation

GitHub Actions / build

; expected

Check failure on line 21 in Plugins/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin/Wrappers/InstanceComparisonExtensionMethods.cs

View workflow job for this annotation

GitHub Actions / build

; expected

Check failure on line 21 in Plugins/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin/Wrappers/InstanceComparisonExtensionMethods.cs

View workflow job for this annotation

GitHub Actions / build

; expected

Check failure on line 21 in Plugins/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin/Wrappers/InstanceComparisonExtensionMethods.cs

View workflow job for this annotation

GitHub Actions / build

; expected

Check failure on line 21 in Plugins/Reqnroll.SpecFlowCompatibility.ReqnrollPlugin/Wrappers/InstanceComparisonExtensionMethods.cs

View workflow job for this annotation

GitHub Actions / build

; expected
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Collections.Generic;
using Reqnroll;

// ReSharper disable once CheckNamespace
namespace TechTalk.SpecFlow.Assist;

public static class SetComparisonExtensionMethods
{
public static void CompareToSet<T>(this Table table, IEnumerable<T> set, bool sequentialEquality = false)
{
Reqnroll.SetComparisonExtensionMethods.CompareToSet(table, set, sequentialEquality);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// ReSharper disable once CheckNamespace
namespace TechTalk.SpecFlow;
public class Table(params string[] header) : Reqnroll.Table(header);
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using Reqnroll;
using Reqnroll.Assist;

// ReSharper disable once CheckNamespace
namespace TechTalk.SpecFlow.Assist;

public static class TableHelperExtensionMethods
{
public static T CreateInstance<T>(this Table table)
{
return Reqnroll.TableHelperExtensionMethods.CreateInstance<T>(table);
}

public static T CreateInstance<T>(this Table table, InstanceCreationOptions creationOptions)
{
return Reqnroll.TableHelperExtensionMethods.CreateInstance<T>(table, creationOptions);
}

public static T CreateInstance<T>(this Table table, Func<T> methodToCreateTheInstance)
{
return Reqnroll.TableHelperExtensionMethods.CreateInstance(table, methodToCreateTheInstance);
}

public static T CreateInstance<T>(this Table table, Func<T> methodToCreateTheInstance, InstanceCreationOptions creationOptions)
{
return Reqnroll.TableHelperExtensionMethods.CreateInstance(table, methodToCreateTheInstance, creationOptions);
}

public static void FillInstance(this Table table, object instance)
{
Reqnroll.TableHelperExtensionMethods.FillInstance(table, instance);
}

public static void FillInstance(this Table table, object instance, InstanceCreationOptions creationOptions)
{
Reqnroll.TableHelperExtensionMethods.FillInstance(table, instance, creationOptions);
}

public static IEnumerable<T> CreateSet<T>(this Table table)
{
return Reqnroll.TableHelperExtensionMethods.CreateSet<T>(table);
}

public static IEnumerable<T> CreateSet<T>(this Table table, InstanceCreationOptions creationOptions)
{
return Reqnroll.TableHelperExtensionMethods.CreateSet<T>(table, creationOptions);
}

public static IEnumerable<T> CreateSet<T>(this Table table, Func<T> methodToCreateEachInstance)
{
return Reqnroll.TableHelperExtensionMethods.CreateSet<T>(table, methodToCreateEachInstance);
}

public static IEnumerable<T> CreateSet<T>(this Table table, Func<T> methodToCreateEachInstance, InstanceCreationOptions creationOptions)
{
return Reqnroll.TableHelperExtensionMethods.CreateSet<T>(table, methodToCreateEachInstance, creationOptions);
}

public static IEnumerable<T> CreateSet<T>(this Table table, Func<TableRow, T> methodToCreateEachInstance)
{
return Reqnroll.TableHelperExtensionMethods.CreateSet<T>(table, methodToCreateEachInstance);
}

public static IEnumerable<T> CreateSet<T>(this Table table, Func<TableRow, T> methodToCreateEachInstance, InstanceCreationOptions creationOptions)
{
return Reqnroll.TableHelperExtensionMethods.CreateSet<T>(table, methodToCreateEachInstance, creationOptions);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
<PackAsTool>true</PackAsTool>
<ToolCommandName>reqnroll-tpg</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Reqnroll</Authors>
<Company>Tricentis</Company>
<PackageProjectUrl>https://github.com/Reqnroll/Reqnroll.TestProjectGenerator</PackageProjectUrl>
<RepositoryUrl>https://github.com/Reqnroll/Reqnroll.TestProjectGenerator</RepositoryUrl>
<Copyright>Copyright © Reqnroll</Copyright>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Description>Command line tool to generate Reqnroll test projects for manual/smoke testing of Reqnroll.</Description>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageIcon>logo.png</PackageIcon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void PluginWithPath()
public void SingleAdditionalStepAssembly()
{
var configuration = new Configuration { UnitTestProvider = Reqnroll.TestProjectGenerator.UnitTestProvider.SpecRun };
configuration.StepAssemblies.Add(new StepAssembly("AdditionalStepAssembly"));
configuration.BindingAssemblies.Add(new BindingAssembly("AdditionalStepAssembly"));

var projectFile = _appConfigGenerator.Generate(configuration);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ public void PluginWithPath()
public void SingleAdditionalStepAssembly()
{
var configuration = new Configuration { UnitTestProvider = Reqnroll.TestProjectGenerator.UnitTestProvider.SpecRun };
configuration.StepAssemblies.Add(new StepAssembly("AdditionalStepAssembly"));
configuration.BindingAssemblies.Add(new BindingAssembly("AdditionalStepAssembly"));

var projectFile = _jsonConfigGenerator.Generate(configuration);

projectFile.Content.Should().Contain(@"""stepAssemblies"":");
projectFile.Content.Should().Contain(@"""bindingAssemblies"":");
projectFile.Content.Should().Contain(@"[{""assembly"":""AdditionalStepAssembly""}]");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Configuration
public UnitTestProvider UnitTestProvider { get; set; } = UnitTestProvider.xUnit;
public List<ReqnrollPlugin> Plugins { get; } = new List<ReqnrollPlugin>();
public List<AppConfigSection> AppConfigSection { get; } = new List<AppConfigSection> { new AppConfigSection(name: "reqnroll", type: "Reqnroll.SpecFlowCompatibility.ReqnrollPlugin.ConfigurationSectionHandler, Reqnroll.SpecFlowCompatibility.ReqnrollPlugin") };
public List<StepAssembly> StepAssemblies { get; } = new List<StepAssembly>();
public List<BindingAssembly> BindingAssemblies { get; } = new List<BindingAssembly>();
public CultureInfo FeatureLanguage { get; set; } = CultureInfo.GetCultureInfo("en-US");
public CultureInfo BindingCulture { get; set; }
public Lazy<Generator> Generator { get; } = new Lazy<Generator>(() => new Generator());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
namespace Reqnroll.TestProjectGenerator.Data
{
public class StepAssembly
public class BindingAssembly


{
public StepAssembly(string assembly)
public BindingAssembly(string assembly)
{
Assembly = assembly;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public ConfigurationDriver(SolutionDriver solutionDriver)
_solutionDriver = solutionDriver;
}

public void AddStepAssembly(StepAssembly stepAssembly)
public void AddStepAssembly(BindingAssembly stepAssembly)
{
AddStepAssembly(_solutionDriver.DefaultProject, stepAssembly);
}
Expand Down Expand Up @@ -62,9 +62,9 @@ public void SetUnitTestProvider(ProjectBuilder project, string unitTestProviderN
project.Configuration.UnitTestProvider = GetUnitTestProvider(unitTestProviderName);
}

public void AddStepAssembly(ProjectBuilder project, StepAssembly stepAssembly)
public void AddStepAssembly(ProjectBuilder project, BindingAssembly stepAssembly)
{
project.Configuration.StepAssemblies.Add(stepAssembly);
project.Configuration.BindingAssemblies.Add(stepAssembly);
}

public void SetConfigurationFormat(ProjectBuilder project, ConfigurationFormat configurationFormat)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void WriteReqnroll(XmlWriter writer, Configuration configuration)
WriteRuntime(writer, configuration.Runtime.Value);
}

WriteStepAssemblies(writer, configuration.StepAssemblies);
WriteStepAssemblies(writer, configuration.BindingAssemblies);

writer.WriteEndElement();
}
Expand Down Expand Up @@ -130,7 +130,7 @@ private void WriteLanguage(XmlWriter writer, CultureInfo featureLanguage)
writer.WriteEndElement();
}

private void WriteStepAssemblies(XmlWriter writer, IEnumerable<StepAssembly> stepAssemblies)
private void WriteStepAssemblies(XmlWriter writer, IEnumerable<BindingAssembly> stepAssemblies)
{
if (stepAssemblies is null) return;
writer.WriteStartElement("stepAssemblies");
Expand All @@ -142,7 +142,7 @@ private void WriteStepAssemblies(XmlWriter writer, IEnumerable<StepAssembly> ste
writer.WriteEndElement();
}

private void WriteStepAssembly(XmlWriter writer, StepAssembly stepAssembly)
private void WriteStepAssembly(XmlWriter writer, BindingAssembly stepAssembly)
{
writer.WriteStartElement("stepAssembly");
writer.WriteAttributeString("assembly", stepAssembly.Assembly);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private void WriteReqnroll(JsonWriter jsonWriter, Configuration configuration)
WriteRuntime(jsonWriter, configuration.Runtime.Value);
}

WriteStepAssemblies(jsonWriter, configuration.StepAssemblies);
WriteStepAssemblies(jsonWriter, configuration.BindingAssemblies);
}

private void WriteUnitTestProvider(JsonWriter jsonWriter, string unitTestProvider)
Expand Down Expand Up @@ -103,7 +103,7 @@ private void WriteBindingCulture(JsonWriter jsonWriter, CultureInfo bindingCultu
jsonWriter.WriteEndObject();
}

private void WriteStepAssemblies(JsonWriter jsonWriter, IEnumerable<StepAssembly> stepAssemblies)
private void WriteStepAssemblies(JsonWriter jsonWriter, IEnumerable<BindingAssembly> stepAssemblies)
{
if (!(stepAssemblies is null))
{
Expand All @@ -121,7 +121,7 @@ private void WriteStepAssemblies(JsonWriter jsonWriter, IEnumerable<StepAssembly
}
}

private void WriteStepAssembly(JsonWriter jsonWriter, StepAssembly stepAssembly)
private void WriteStepAssembly(JsonWriter jsonWriter, BindingAssembly stepAssembly)
{
// open stepAssembly object
jsonWriter.WriteStartObject();
Expand Down
15 changes: 0 additions & 15 deletions Reqnroll.sln
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Reqnroll.NUnit.Generator.Re
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Reqnroll.PluginTests", "Tests\Reqnroll.PluginTests\Reqnroll.PluginTests.csproj", "{204B619C-6D4B-4384-B1E9-E231BA0081BF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Reqnroll.NUnit.Runners", "Installer\Reqnroll.NUnit.Runners\Reqnroll.NUnit.Runners.csproj", "{57335C6A-F74A-491A-8191-95E115B87638}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Reqnroll.CustomPlugin", "Installer\Reqnroll.CustomPlugin\Reqnroll.CustomPlugin.csproj", "{FA9DFEFA-4F35-4A57-91AE-64C7B5D41EAA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Reqnroll.MsBuildNetSdk.IntegrationTests", "Tests\Reqnroll.MsBuildNetSdk.IntegrationTests\Reqnroll.MsBuildNetSdk.IntegrationTests.csproj", "{02A08F81-B90F-4EB3-9C30-CE7447DE2012}"
Expand Down Expand Up @@ -357,18 +355,6 @@ Global
{204B619C-6D4B-4384-B1E9-E231BA0081BF}.Release|Any CPU.Build.0 = Release|Any CPU
{204B619C-6D4B-4384-B1E9-E231BA0081BF}.VS2010IntegrationTest|Any CPU.ActiveCfg = Debug|Any CPU
{204B619C-6D4B-4384-B1E9-E231BA0081BF}.VS2010IntegrationTest|Any CPU.Build.0 = Debug|Any CPU
{57335C6A-F74A-491A-8191-95E115B87638}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57335C6A-F74A-491A-8191-95E115B87638}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57335C6A-F74A-491A-8191-95E115B87638}.Debug-MSTest|Any CPU.ActiveCfg = Debug|Any CPU
{57335C6A-F74A-491A-8191-95E115B87638}.Debug-MSTest|Any CPU.Build.0 = Debug|Any CPU
{57335C6A-F74A-491A-8191-95E115B87638}.Debug-NUnit|Any CPU.ActiveCfg = Debug|Any CPU
{57335C6A-F74A-491A-8191-95E115B87638}.Debug-NUnit|Any CPU.Build.0 = Debug|Any CPU
{57335C6A-F74A-491A-8191-95E115B87638}.Debug-XUnit|Any CPU.ActiveCfg = Debug|Any CPU
{57335C6A-F74A-491A-8191-95E115B87638}.Debug-XUnit|Any CPU.Build.0 = Debug|Any CPU
{57335C6A-F74A-491A-8191-95E115B87638}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57335C6A-F74A-491A-8191-95E115B87638}.Release|Any CPU.Build.0 = Release|Any CPU
{57335C6A-F74A-491A-8191-95E115B87638}.VS2010IntegrationTest|Any CPU.ActiveCfg = Debug|Any CPU
{57335C6A-F74A-491A-8191-95E115B87638}.VS2010IntegrationTest|Any CPU.Build.0 = Debug|Any CPU
{FA9DFEFA-4F35-4A57-91AE-64C7B5D41EAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA9DFEFA-4F35-4A57-91AE-64C7B5D41EAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA9DFEFA-4F35-4A57-91AE-64C7B5D41EAA}.Debug-MSTest|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -546,7 +532,6 @@ Global
{556F5CA5-5497-4F32-9926-77A9369AB09C} = {8BE0FE31-6A52-452E-BE71-B8C64A3ED402}
{69473C7E-DBA7-478B-AE6D-C185AA910FD2} = {8BE0FE31-6A52-452E-BE71-B8C64A3ED402}
{204B619C-6D4B-4384-B1E9-E231BA0081BF} = {0359B7D7-7E29-48E9-8DF9-7D1FACFA5CFA}
{57335C6A-F74A-491A-8191-95E115B87638} = {DCE0C3C4-5BC6-4A30-86BE-3FEFF4677A01}
{FA9DFEFA-4F35-4A57-91AE-64C7B5D41EAA} = {DCE0C3C4-5BC6-4A30-86BE-3FEFF4677A01}
{02A08F81-B90F-4EB3-9C30-CE7447DE2012} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437}
{48E162BC-9431-450D-8353-66D396DCB5FE} = {577A0375-1436-446C-802B-3C75C8CEF94F}
Expand Down
4 changes: 3 additions & 1 deletion Reqnroll/Assist/InstanceComparisonExtensionMethods.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Reqnroll.Assist;

namespace Reqnroll.Assist
// ReSharper disable once CheckNamespace
namespace Reqnroll
{
public static class InstanceComparisonExtensionMethods
{
Expand Down
3 changes: 2 additions & 1 deletion Reqnroll/Assist/SetComparisonExtensionMethods.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using Reqnroll.Assist;

namespace Reqnroll.Assist
namespace Reqnroll
{
public static class SetComparisonExtensionMethods
{
Expand Down
4 changes: 3 additions & 1 deletion Reqnroll/Assist/TableExtensionMethods.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using Reqnroll.Assist;

namespace Reqnroll.Assist
// ReSharper disable once CheckNamespace
namespace Reqnroll
{
public static class TableHelperExtensionMethods
{
Expand Down
3 changes: 3 additions & 0 deletions Reqnroll/BindingSkeletons/StepDefinitionSkeletonStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ public enum StepDefinitionSkeletonStyle
{
[Description("Regular expressions in attributes")]
RegexAttribute = 0,
// legacy config
[Description("Method name - underscores")]
MethodNameUnderscores = 1,
// legacy config
[Description("Method name - pascal case")]
MethodNamePascalCase = 2,
// legacy config
[Description("Method name as regulare expression (F#)")]
MethodNameRegex = 3,
[Description("Cucumber expressions in attributes")]
Expand Down
2 changes: 2 additions & 0 deletions Reqnroll/Configuration/JsonConfig/BindingCultureElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

namespace Reqnroll.Configuration.JsonConfig
{
// legacy config
public class BindingCultureElement
{
// legacy config
//[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Populate, NullValueHandling = NullValueHandling.Ignore)]
[DataMember(Name="name")]
public string Name { get; set; }
Expand Down
Loading

0 comments on commit 55808f7

Please sign in to comment.