Skip to content

Commit

Permalink
Added paramter name + fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sudarshan0212 committed Apr 19, 2019
1 parent c4cfa75 commit e5a2570
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions GingerPythonPluginConsole/Arg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ namespace GingerPythonPluginConsole
{
public class Arg
{
public string value { get; set; }
public Arg(String val)
public string Param { get; set; }
public string Value { get; set; }
public Arg(String param, String value)
{
value = val;
Param = param;
Value = value;
}
}
}
4 changes: 2 additions & 2 deletions GingerPythonPluginConsole/GingerPythonService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void RunScript(IGingerAction GA, string scriptContent,List<Arg> args=null
SetContent(scriptContent);
if (args != null){
foreach (Arg a in args)
scope.AddVariable(a.value);
scope.AddVariable(a.Value);
}

p.Execute(scope);
Expand All @@ -49,7 +49,7 @@ public void RunScriptFile(IGingerAction GA, string scriptFileName, List<Arg> ar
if (args != null)
{
foreach (Arg a in args)
scope.AddVariable(a.value);
scope.AddVariable(a.Value);
}

p.Execute(scope);
Expand Down
8 changes: 4 additions & 4 deletions GingerPythonPluginTest/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ public void RunScript6()
print('sum=' + str(sum))";
//Act
List<Arg> args = new List<Arg>();
args.Add(new Arg("4"));
args.Add(new Arg("7"));
args.Add(new Arg("Param 1", "4"));
args.Add(new Arg("Param 2", "7"));
service.RunScript(GA, script6, args);


Expand All @@ -174,8 +174,8 @@ public void RunScript7()

//Act
List<Arg> args = new List<Arg>();
args.Add(new Arg("5"));
args.Add(new Arg("6"));
args.Add(new Arg("Param 1", "5"));
args.Add(new Arg("Param 2", "6"));

service.RunScriptFile(GA, TestResources.GetTestResourcesFile("sum-file.py"), args);

Expand Down

0 comments on commit e5a2570

Please sign in to comment.