Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
prashelke committed Jul 18, 2024
1 parent afefd7f commit dbb8143
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public partial class ValueExpressionMockDataEditorPage : Page
SelectedContentArgs mSelectedContentArgs;
Context mContext;
string mObj;
static List<string> Localelst;
static List<string> objClasses;
List<string> Localelst;
List<string> objClasses;
public ValueExpressionMockDataEditorPage(Context context, SelectedContentArgs SelectedContentArgs, string obj, string function, string Locale, string MockExpression)
{
try
Expand All @@ -55,7 +55,7 @@ public ValueExpressionMockDataEditorPage(Context context, SelectedContentArgs Se

Localelst = Localelst ?? GetLocales();
Type objType;
List<string> methodList = new();
List<string> methodList;

Assembly assembly = Assembly.Load("Bogus"); // or load your target assembly

Expand Down Expand Up @@ -90,7 +90,6 @@ public ValueExpressionMockDataEditorPage(Context context, SelectedContentArgs Se

private static List<string> GetLocales()
{
// Replace with actual implementation to fetch locales
return Bogus.Database.GetAllLocales().ToList();
}

Expand Down
4 changes: 1 addition & 3 deletions Ginger/GingerCoreNET/ValueExpressionLib/ValueExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,16 +415,14 @@ private static void MockdataExpressionExtract(string MockDataExpression, out str
{
objStr = string.Empty;
functions = string.Empty;
string Datasetobject = string.Empty;
Locale = string.Empty;
DatasetStartIndex = MockDataExpression.IndexOf('=');
DatasetEndIndex = MockDataExpression.IndexOf('(');
LocaleStartIndex = MockDataExpression.IndexOf('"');
LocaleEndIndex = MockDataExpression.IndexOf(')');
int functionstartindex = MockDataExpression.IndexOf('.');
string funsubstring = MockDataExpression.Substring(functionstartindex + 1); ;
string funsubstring = MockDataExpression.Substring(functionstartindex + 1);
int functionendindex = funsubstring.IndexOf('(');
Datasetobject = MockDataExpression.Substring(DatasetStartIndex + 1, DatasetEndIndex - 1 - DatasetStartIndex);
Locale = MockDataExpression.Substring(LocaleStartIndex + 1, LocaleEndIndex - 2 - LocaleStartIndex);
objStr = MockDataExpression.Substring(DatasetStartIndex + 1, DatasetEndIndex - 1 - DatasetStartIndex);
functions = funsubstring.Substring(0, functionendindex).Replace("\"", "").Trim();
Expand Down

0 comments on commit dbb8143

Please sign in to comment.