Skip to content

Commit

Permalink
style updates to NotificationMethodGeneratorTest to make codeql happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Svensson committed Jan 22, 2024
1 parent e0db2e0 commit ddc11c3
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.CodeDom;
using System.Collections.Generic;
using OpenRiaServices.Server;
using OpenRiaServices.Server.Test.Utilities;
using System.Xml;
using Microsoft.VisualStudio.TestTools.UnitTesting;

Expand Down Expand Up @@ -41,7 +40,7 @@ public static IEnumerable<object> PartialMethodsSnippetBlockTestCases
DynamicData(nameof(PartialMethodsSnippetBlockTestCases))]
public void PartialMethodsSnippetBlockTest(string comments, string baseMethodNames, string parameters)
{
string[] baseMethodNamesArray = baseMethodNames.Split(new char[] { ',' });
string[] baseMethodNamesArray = baseMethodNames.Split(',');

PartialMethodsSnippetBlockTest(true, comments, baseMethodNamesArray, parameters);
PartialMethodsSnippetBlockTest(false, comments, baseMethodNamesArray, parameters);
Expand Down Expand Up @@ -108,7 +107,7 @@ public static IEnumerable<object> OnCreatedMethodInvokeExpressionTestCases
]
public void GetMethodInvokeExpressionStatementForTest(string comments, string baseMethodNames, string parameters)
{
string[] baseMethodNamesArray = baseMethodNames.Split(new char[] { ',' });
string[] baseMethodNamesArray = baseMethodNames.Split(',');

GetMethodInvokeExpressionStatementForTest(true, comments, baseMethodNamesArray, parameters);
GetMethodInvokeExpressionStatementForTest(false, comments, baseMethodNamesArray, parameters);
Expand All @@ -128,7 +127,7 @@ public void GetMethodInvokeExpressionStatementForTest(bool isCSharp, string comm
target.AddMethodFor(baseMethodName, expressions, comments);

CodeExpressionStatement actual = target.GetMethodInvokeExpressionStatementFor(baseMethodName);
CodeMethodInvokeExpression actualExpression = actual.Expression as CodeMethodInvokeExpression;
CodeMethodInvokeExpression actualExpression = (CodeMethodInvokeExpression)actual.Expression;

Assert.AreEqual("On" + baseMethodName, actualExpression.Method.MethodName);

Expand Down Expand Up @@ -188,7 +187,7 @@ public void AddMethodFor2Test(bool isCSharp, string comments, string paramDeclAr
}
else if (paramDeclArgs != "null")
{
string[] args = paramDeclArgs.Split(new char[] { ',' });
string[] args = paramDeclArgs.Split(',');
parameterDeclaration = new CodeParameterDeclarationExpression(args[0], args[1]);
}

Expand Down Expand Up @@ -251,12 +250,12 @@ private static CodeParameterDeclarationExpressionCollection GetCodeParameterDecl
{
parameters = new CodeParameterDeclarationExpressionCollection();

string[] paramDecls = paramDeclsArgs.Split(new char[] { ';' });
string[] paramDecls = paramDeclsArgs.Split(';');
foreach (string paramDecl in paramDecls)
{
if (paramDecl != "")
{
string[] args = paramDecl.Split(new char[] { ',' });
string[] args = paramDecl.Split(',');
Assert.AreEqual(2, args.Length, "Params definition file not in the correct format!");
CodeParameterDeclarationExpression codeParam = new CodeParameterDeclarationExpression(args[0], args[1]);
parameters.Add(codeParam);
Expand Down

0 comments on commit ddc11c3

Please sign in to comment.