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
5 changes: 2 additions & 3 deletions src/Codebelt.Extensions.Xunit/StringExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#if NETSTANDARD2_0_OR_GREATER
using System;
using System.Text.RegularExpressions;
using Cuemon;

namespace Codebelt.Extensions.Xunit
{
Expand Down Expand Up @@ -36,8 +35,8 @@ public static string ReplaceLineEndings(this string input)
/// </exception>
public static string ReplaceLineEndings(this string input, string replacementText)
{
Validator.ThrowIfNull(input);
Validator.ThrowIfNull(replacementText);
if (input == null) { throw new ArgumentNullException(nameof(input)); }
if (replacementText == null) { throw new ArgumentNullException(nameof(replacementText)); }
return NewLineRegex.Replace(input, replacementText);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Codebelt.Extensions.Xunit/Test.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Linq;
using System.Text.RegularExpressions;
using Cuemon;
using Xunit.Abstractions;

namespace Codebelt.Extensions.Xunit
Expand All @@ -25,7 +24,8 @@ public abstract class Test : ITest
/// </exception>
public static bool Match(string expected, string actual, Action<WildcardOptions> setup = null)
{
Validator.ThrowIfInvalidConfigurator(setup, out var options);
var options = new WildcardOptions();
setup?.Invoke(options);

var pattern = $"^{Regex.Escape(expected).Replace(options.SingleCharacter, ".").Replace(options.GroupOfCharacters, ".*")}$";

Expand Down
3 changes: 1 addition & 2 deletions src/Codebelt.Extensions.Xunit/WildcardOptions.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using Cuemon.Configuration;

namespace Codebelt.Extensions.Xunit
{
/// <summary>
/// Configuration options for <see cref="Test.Match"/>.
/// </summary>
public class WildcardOptions : IParameterObject
public class WildcardOptions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Issues Found: Remaining References to IParameterObject and Cuemon

The interface IParameterObject is still referenced in the following file:

  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/BoolOptions.cs

Additionally, the Cuemon namespace is still used in multiple files, indicating that dependencies on the Cuemon library have not been fully removed:

  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostFixture.cs
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/HttpClientExtensions.cs
  • src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs
  • src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs
  • src/Codebelt.Extensions.Xunit/InMemoryTestStore.cs
  • src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs
  • src/Codebelt.Extensions.Xunit/TestOutputHelperExtensions.cs
  • src/Codebelt.Extensions.Xunit.Hosting/LoggerExtensions.cs
  • src/Codebelt.Extensions.Xunit.Hosting/HostFixture.cs
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/Http/FakeHttpContextAccessor.cs
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/WebHostTestFactoryTest.cs
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/HostTestTest.cs
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/Assets/ScopedCorrelation.cs
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/BoolOptions.cs
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/Assets/SingletonCorrelation.cs
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/Assets/TransientCorrelation.cs
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/BoolMiddleware.cs

Please address these remaining references to fully align with the PR objectives.

🔗 Analysis chain

Approved: Removal of IParameterObject interface

The removal of the IParameterObject interface from the WildcardOptions class aligns with the PR objective of reducing dependencies on the Cuemon library. This change simplifies the class and reduces external dependencies.

To ensure this change doesn't introduce any issues, please run the following script to check for any remaining references to IParameterObject in the codebase:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to IParameterObject

# Search for IParameterObject references
echo "Searching for IParameterObject references:"
rg "IParameterObject" --type cs

# Search for any remaining Cuemon namespace usages
echo "Searching for Cuemon namespace usages:"
rg "using.*Cuemon" --type cs

Length of output: 2386

{
/// <summary>
/// Initializes a new instance of the <see cref="WildcardOptions"/> class.
Expand Down