|
11 | 11 | namespace Tests.DataGenerator { |
12 | 12 | public static class Runner { |
13 | 13 | public static int total = 0; |
14 | | - private static int counter = 0; |
| 14 | + private static string formatter = ObjectNotation; |
| 15 | + private static string language = VisualBasic; |
15 | 16 | public static readonly List<string> lines = new List<string>(); |
| 17 | + //public static NodeTypeExpressionTypeMapper visitor = new NodeTypeExpressionTypeMapper(); |
16 | 18 | public static void WriteData(object o, string testData) { |
17 | 19 | string toWrite; |
18 | 20 | switch (o) { |
19 | 21 | case Expression expr: |
20 | | - toWrite = expr.ToString(FactoryMethods); |
| 22 | + toWrite = expr.ToString(formatter, language); |
21 | 23 | break; |
22 | 24 | case MemberBinding mbind: |
23 | | - toWrite = mbind.ToString(FactoryMethods); |
| 25 | + toWrite = mbind.ToString(formatter, language); |
24 | 26 | break; |
25 | 27 | case ElementInit init: |
26 | | - toWrite = init.ToString(FactoryMethods); |
| 28 | + toWrite = init.ToString(formatter, language); |
27 | 29 | break; |
28 | 30 | case SwitchCase switchCase: |
29 | | - toWrite = switchCase.ToString(FactoryMethods); |
| 31 | + toWrite = switchCase.ToString(formatter, language); |
30 | 32 | break; |
31 | 33 | case CatchBlock catchBlock: |
32 | | - toWrite = catchBlock.ToString(FactoryMethods); |
| 34 | + toWrite = catchBlock.ToString(formatter, language); |
33 | 35 | break; |
34 | 36 | case LabelTarget labelTarget: |
35 | | - toWrite = labelTarget.ToString(FactoryMethods); |
| 37 | + toWrite = labelTarget.ToString(formatter, language); |
36 | 38 | break; |
37 | 39 | default: |
38 | 40 | throw new NotImplementedException(); |
39 | 41 | } |
40 | 42 |
|
41 | | - if (testData.IsNullOrWhitespace()) { |
42 | | - counter += 1; |
43 | | - lines.AddRange(new[] { |
44 | | - "\"" + toWrite.Replace("\"", "\"\"") + "\"", |
45 | | - $"{TestMethodName()}", |
46 | | - "" |
47 | | - }); |
48 | | - } |
| 43 | + lines.AddRange(new[] { |
| 44 | + "\"" + toWrite.Replace("\"", "\"\"") + "\"", |
| 45 | + $"{TestMethodName()}", |
| 46 | + "" |
| 47 | + }); |
| 48 | + |
| 49 | + //visitor.VisitExt(o); |
49 | 50 |
|
50 | 51 | string TestMethodName() { |
51 | 52 | var mi = new StackTrace().GetFrames().Select(x => x.GetMethod()).FirstOrDefault(x => x.DeclaringType.BaseType == typeof(TestsBase)); |
|
0 commit comments