Skip to content

Commit

Permalink
Build Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoMarlow committed Dec 11, 2024
1 parent b0f32f9 commit bfab95b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
3 changes: 1 addition & 2 deletions Assignment.tests/PingProcessTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using IntelliTect.TestTools;
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
Expand Down
4 changes: 2 additions & 2 deletions Assignment.tests/StringExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace IntelliTect.TestTools;
namespace Assignment.Tests;

/// <summary>
/// Useful string extensions for performing assertions.
Expand All @@ -14,7 +14,7 @@ public static class StringExtensions
/// <param name="s">The string to match</param>
/// <param name="pattern">The pattern to match it against.</param>
/// <returns></returns>
public static bool IsLikeRegEx(this string s, string pattern) =>
public static bool IsLikeRegExChacter(this string s, string pattern) =>
new Regex(pattern, RegexOptions.IgnoreCase).IsMatch(s);

/// <summary>
Expand Down
16 changes: 8 additions & 8 deletions Assignment.tests/WildCardPattern.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Text;
using System.Text.RegularExpressions;

namespace IntelliTect.TestTools
namespace Assignment.Tests

Check failure on line 12 in Assignment.tests/WildCardPattern.cs

View workflow job for this annotation

GitHub Actions / Run Shared Build and Test Workflow / build-and-test

Convert to file-scoped namespace (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0161)

Check failure on line 12 in Assignment.tests/WildCardPattern.cs

View workflow job for this annotation

GitHub Actions / Run Shared Build and Test Workflow / build-and-test

Convert to file-scoped namespace (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0161)
{
/// <summary>
/// Provides enumerated values to use to set wildcard pattern
Expand Down Expand Up @@ -400,7 +400,7 @@ public static string NormalizeLineEndings(string input, bool trimTrailingNewline
// https://stackoverflow.com/questions/140926/normalize-newlines-in-c-sharp
input = NormalizeNewLines().Replace(input, Environment.NewLine);

if (trimTrailingNewline && input.EndsWith(Environment.NewLine))
if (trimTrailingNewline && input.EndsWith(Environment.NewLine, StringComparison.Ordinal))
{
input = input.Substring(0, input.Length - Environment.NewLine.Length);
}
Expand Down Expand Up @@ -886,7 +886,7 @@ internal bool IsMatch(string str)
return patternPositionsForCurrentStringPosition.ReachedEndOfPattern;
}

private class PatternPositionsVisitor
private sealed class PatternPositionsVisitor
{
private readonly int _lengthOfPattern;

Expand Down Expand Up @@ -1014,7 +1014,7 @@ public override void ProcessEndOfString(
}
}

private class LiteralCharacterElement : QuestionMarkElement
private sealed class LiteralCharacterElement : QuestionMarkElement
{
private readonly char _literalCharacter;

Expand All @@ -1040,7 +1040,7 @@ public override void ProcessStringCharacter(
}
}

private class BracketExpressionElement : QuestionMarkElement
private sealed class BracketExpressionElement : QuestionMarkElement
{
private readonly Regex _Regex;

Expand All @@ -1064,7 +1064,7 @@ public override void ProcessStringCharacter(
}
}

private class AsterixElement : PatternElement
private sealed class AsterixElement : PatternElement
{
public override void ProcessStringCharacter(
char currentStringCharacter,
Expand All @@ -1088,7 +1088,7 @@ public override void ProcessEndOfString(
}
}

private class MyWildcardPatternParser : WildcardPatternParser
private sealed class MyWildcardPatternParser : WildcardPatternParser
{
private readonly List<PatternElement> _patternElements = new();
private CharacterNormalizer _characterNormalizer;
Expand Down Expand Up @@ -1191,7 +1191,7 @@ public char Normalize(char x)
/// <summary>
/// Translates a <see cref="WildcardPattern"/> into a DOS wildcard
/// </summary>
internal class WildcardPatternToDosWildcardParser : WildcardPatternParser
internal sealed class WildcardPatternToDosWildcardParser : WildcardPatternParser
{
private readonly StringBuilder _result = new();

Expand Down

0 comments on commit bfab95b

Please sign in to comment.