Skip to content

Commit

Permalink
Code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
huaxing-yuan committed May 3, 2024
1 parent a1c95a1 commit 8816f7c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/AxaFrance.AxeExtended.Selenium/AxeExtendedBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace AxaFrance.AxeExtended.Selenium
{
/// <summary>
/// ExtendedBuilder for Axe Core. This class is used to configure and run axe against a web page.
/// This class is a fork of original AxeBuilder class from Deque AxeCore.
/// This class is a fork of original AxeBuilder class from Deque AxeCore per https://github.com/dequelabs/axe-core-nuget/issues/146
/// There is no possibility to use a custom configuration file with the original AxeBuilder class, so we need to create this class and expose the WithAxeConfig method.
/// With this method, we can pass a custom configuration file to the axe engine and run custom rules in addition to default axe rules.
/// </summary>
Expand Down Expand Up @@ -87,7 +87,7 @@ public AxeExtendedBuilder UseLegacyMode(bool legacyMode = true)

/// <summary>
/// Run configuration data that is passed to axe for scanning the web page.
/// This will override the value set by <see cref="WithRules(string[])"/>, <see cref="WithTags(string[])"/> & <see cref="DisableRules(string[])"/>
/// This will override the value set by <see cref="WithRules(string[])"/>, <see cref="WithTags(string[])"/> &amp; <see cref="DisableRules(string[])"/>
/// </summary>
/// <param name="runOptions">run options to be used for scanning</param>
public AxeExtendedBuilder WithOptions(AxeRunOptions runOptions)
Expand Down Expand Up @@ -120,7 +120,7 @@ public AxeExtendedBuilder WithTags(params string[] tags)
/// <summary>
/// Limit analysis to only the specified rules.
/// Refer https://dequeuniversity.com/rules/axe/ to get the complete listing of available rule IDs.
/// Cannot be used with <see cref="WithTags(string[])"/> & <see cref="Options"/>
/// Cannot be used with <see cref="WithTags(string[])"/> &amp; <see cref="WithOptions(AxeRunOptions)"/>
/// </summary>
/// <param name="rules">rule IDs to be used for scanning</param>
public AxeExtendedBuilder WithRules(params string[] rules)
Expand Down Expand Up @@ -474,7 +474,7 @@ private static void ValidateParameters(string[] parameterValue, string parameter

private static void ValidateNotNullParameter<T>(T parameterValue, string parameterName)
{
if (parameterValue is null)
if (parameterValue == null)
{
throw new ArgumentNullException(parameterName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

namespace AxaFrance.AxeExtended.Selenium
{

/// <summary>
/// This classe if forked from Deque Axe Core project to add capability to run customized rules like other language.
/// per https://github.com/dequelabs/axe-core-nuget/issues/146
/// </summary>
internal static class WebDriverInjectorExtensions
{
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/AxaFrance.WebEngine/EnvironmentVariables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public string GetValue(string name)
else
{
string value = this.Variables.Find(x => x.Name == name).Value;
while (value.StartsWith('$'))
while (value.StartsWith("$"))
{
value = this.Variables.Find(x => x.Name == value.Substring(1)).Value;
}
Expand Down
4 changes: 2 additions & 2 deletions src/AxaFrance.WebEngine/SharedActionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static SharedActionBase DoAction(Type sharedActionType, TestCase relatedT
foreach (var p in obj.RequiredParameters)
{
//Test if the value is given
var param = parameters.FirstOrDefault(x => x.Name == p.Name);
var param = Array.Find(parameters, x => x.Name == p.Name);
if (param == null)
{
if (p.Value != null)
Expand Down Expand Up @@ -349,7 +349,7 @@ public Type GetType(string action)
Type[] types = ass.GetTypes();
Type t;

t = types.FirstOrDefault(x => x.Name == action);
t = Array.Find(types, x => x.Name == action));

Check failure on line 352 in src/AxaFrance.WebEngine/SharedActionBase.cs

View workflow job for this annotation

GitHub Actions / build

; expected

Check failure on line 352 in src/AxaFrance.WebEngine/SharedActionBase.cs

View workflow job for this annotation

GitHub Actions / build

} expected

Check failure on line 352 in src/AxaFrance.WebEngine/SharedActionBase.cs

View workflow job for this annotation

GitHub Actions / build

; expected

Check failure on line 352 in src/AxaFrance.WebEngine/SharedActionBase.cs

View workflow job for this annotation

GitHub Actions / build

} expected

Check failure on line 352 in src/AxaFrance.WebEngine/SharedActionBase.cs

View workflow job for this annotation

GitHub Actions / build

; expected

Check failure on line 352 in src/AxaFrance.WebEngine/SharedActionBase.cs

View workflow job for this annotation

GitHub Actions / build

} expected

Check failure on line 352 in src/AxaFrance.WebEngine/SharedActionBase.cs

View workflow job for this annotation

GitHub Actions / build

; expected

Check failure on line 352 in src/AxaFrance.WebEngine/SharedActionBase.cs

View workflow job for this annotation

GitHub Actions / build

} expected

Check failure on line 352 in src/AxaFrance.WebEngine/SharedActionBase.cs

View workflow job for this annotation

GitHub Actions / build

; expected

Check failure on line 352 in src/AxaFrance.WebEngine/SharedActionBase.cs

View workflow job for this annotation

GitHub Actions / build

} expected
if (t != null)
{
return t;
Expand Down

0 comments on commit 8816f7c

Please sign in to comment.