本文整理汇总了C#中ProtoTestFx.WatchTestFx类的典型用法代码示例。如果您正苦于以下问题:C# WatchTestFx类的具体用法?C# WatchTestFx怎么用?C# WatchTestFx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WatchTestFx类属于ProtoTestFx命名空间,在下文中一共展示了WatchTestFx类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: debugwatch065
public void debugwatch065()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
string src = @"
WCS = CoordinateSystem.Identity();";
WatchTestFx.GeneratePrintStatements(src, ref map);
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(null, src, map);
}
示例2: debugwatch066
public void debugwatch066()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
string src = @" import(""ProtoGeometry.dll"");
import(""file_1467252.ds"");
WCS = CoordinateSystem.Identity();
newCS = WCS.Translate(Vector.ByCoordinates(0, 1, 0));";
WatchTestFx.GeneratePrintStatements(src, ref map);
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(null, src, map);
}
示例3: DebugWatch0_array
public void DebugWatch0_array()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
string src = @"
[Associative]
{
/*
a = {1001,1002};
a[0] = 1234;
a[1] = 5678;
x = a[1];
y = a[0];
b = {101, 102, {103, 104}, 105};
b[2][1] = 100001;
c = {
101,
102,
{103, 104},
{{1001, 2002}, 1},
5
};
c[2][1] = 111111;
c[3][0][1] = 222222;
c[3][0][0] = 333333;
d = {
{1, 0, 0, 0},
{0, 1, 0, 0},
{0, 0, 1, 0},
{0, 0, 0, 1}
};
d[0][0] = c[2][1];
d[1][1] = 2;
d[2][2] = 2;
d[3][3] = x;
*/
e = {10,{20,30}};
e[1][1] = 40;
dd = e[0];
dd = e[1][0];
dd = e[1][1];
}
";
WatchTestFx.GeneratePrintStatements(src, ref map);
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(null, src, map);
}
示例4: DebugWatch1001_T20_Defect_1458567_2
public void DebugWatch1001_T20_Defect_1458567_2()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
String filePath = @"..\..\..\Scripts\TD\MultiLanguage\CollectionAssignment\T20_Defect_1458567_2.ds";
StreamReader file = new StreamReader(filePath);
WatchTestFx.GeneratePrintStatements(file, ref map);
file = new StreamReader(filePath);
String src = file.ReadToEnd();
file.Close();
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(Path.GetFullPath(filePath), src, map);
}
示例5: DebugWatch0_array
public void DebugWatch0_array()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
String filePath = @"..\..\..\Scripts\array.ds";
StreamReader file = new StreamReader(filePath);
WatchTestFx.GeneratePrintStatements(file, ref map);
file = new StreamReader(filePath);
String src = file.ReadToEnd();
file.Close();
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(Path.GetFullPath(filePath), src, map);
}
示例6: T002_Defect_1467629_Debugging_InlineCondition_With_Multiple_Return_Types
public void T002_Defect_1467629_Debugging_InlineCondition_With_Multiple_Return_Types()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
string src = @"class B
{
b = 0;
constructor B(xx)
{
b = xx;
}
}
class A
{
x : var[]..[];
constructor A(a : int) //example constructor
{
x = a == 1 ? B.B(1) : { B.B(0), B.B(2) }; // using an in-line conditional
}
}
c = 2;
aa = A.A(c);
c = 1;";
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(null, src, map);
}
示例7: DebugWatch387_T001_Simple_Update
public void DebugWatch387_T001_Simple_Update()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
string src = @"a = 1;
b = a + 1;
a = 2;";
WatchTestFx.GeneratePrintStatements(src, ref map);
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(null, src, map);
}
示例8: DebugWatch385_T55_3_of_3_Exprs_are_Lists_Same_Length
public void DebugWatch385_T55_3_of_3_Exprs_are_Lists_Same_Length()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
string src = @"list1 = { true, false, false, true };
list2 = { 1, 2, 3, 4 };
list3 = { -1, -2, -3, -4 };
list4 = list1 ? list2 : list3; // { 1, -2, -3, 4 }
list5 = !list1 ? list2 : list3; // { -1, 2, 3, -4 }
a = { 1, 4, 7 };
b = { 2, 8, 5 };
c = { 6, 9, 3 };
list6 = a > b ? b + c : b - c; // { -4, -1, 8 }";
WatchTestFx.GeneratePrintStatements(src, ref map);
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(null, src, map);
}
示例9: DebugWatch383_T53_3_of_3_Exprs_are_different_dimension_list
public void DebugWatch383_T53_3_of_3_Exprs_are_different_dimension_list()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
string src = @"a = { { 1, 2, 3 }, { 4, 5, 6 } };
b = { { 1, 2 }, { 3, 4 }, { 5, 6 } };
c = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 10, 11, 12 } };
list = a > b ? b + c : a + c; // { { 2, 4, }, { 8, 10 } } ";
WatchTestFx.GeneratePrintStatements(src, ref map);
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(null, src, map);
}
示例10: DebugWatch381_T51_2_of_3_Exprs_are_Lists_Different_Length
public void DebugWatch381_T51_2_of_3_Exprs_are_Lists_Different_Length()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
string src = @"list1 = { 1, 2, 3, 4, 5 };
list2 = { true, false, true, false };
list3 = list2 ? list1 : 0; // { 1, 0, 3, 0 }
list4 = list2 ? 0 : list1; // { 0, 2, 0, 4 }
list5 = { -1, -2, -3, -4, -5, -6 };
list6 = true ? list1 : list5; // { 1, 2, 3, 4, 5 }
list7 = false ? list1 : list5; // { -1, -2, -3, -4, -5 }
a = { 1, 2, 3, 4 };
b = { 5, 4, 3, 2, 1 };
c = { 1, 4, 7 };
list8 = a >= b ? a + c : 10; // { 10, 10, 10 }
list9 = a < b ? 10 : a + c; // { 10, 10, 10 }";
WatchTestFx.GeneratePrintStatements(src, ref map);
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(null, src, map);
}
示例11: DebugWatch379_T50_Replication_Imperative_Scope
public void DebugWatch379_T50_Replication_Imperative_Scope()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
string src = @"c;
[Imperative]
{
def even : int (a : int)
{
if(( a % 2 ) > 0 )
return = a + 1;
else
return = a;
return = 0;
}
x = { 1, 2, 3 };
c = even(x);
}
";
WatchTestFx.GeneratePrintStatements(src, ref map);
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(null, src, map);
}
示例12: DebugWatch369_T41_Pass_3x3_List_And_2x4_List
public void DebugWatch369_T41_Pass_3x3_List_And_2x4_List()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
string src = @"def foo : int(a : int, b : int)
{
return = a * b;
}
list1 = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
list2 = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 } };
list3 = foo(list1, list2); // { { 1, 4, 9 }, { 20, 30, 42 } }
x = list3[0];
y = list3[1];";
WatchTestFx.GeneratePrintStatements(src, ref map);
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(null, src, map);
}
示例13: DebugWatch368_T40_Pass_2_List_of_class_type_Same_Length
public void DebugWatch368_T40_Pass_2_List_of_class_type_Same_Length()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
string src = @"class Point_3D
{
x : var;
y : var;
z : var;
constructor ValueCtor(_x : int, _y : int, _z : int)
{
x = _x;
y = _y;
z = _z;
}
def GetCoor(type : int)
{
return = type == 1 ? x : type == 2 ? y : z;
}
}
def GetMidPoint : Point_3D(p1 : Point_3D, p2 : Point_3D)
{
return = Point_3D.ValueCtor(
(p1.GetCoor(1) + p2.GetCoor(1)),
(p1.GetCoor(2) + p2.GetCoor(2)),
(p1.GetCoor(3) + p2.GetCoor(3))
);
}
list1 = {
Point_3D.ValueCtor(1, 2, 3),
Point_3D.ValueCtor(4, 5, 6),
Point_3D.ValueCtor(7, 8, 9)
};
list2 = {
Point_3D.ValueCtor(10, 11, 12),
Point_3D.ValueCtor(13, 14, 15),
Point_3D.ValueCtor(16, 17, 18)
};
list3 = GetMidPoint(list1, list2);
list3_0_x = list3[0].GetCoor(1); // 11
list3_1_y = list3[1].GetCoor(2); // 19
list3_2_z = list3[2].GetCoor(3); // 27
";
WatchTestFx.GeneratePrintStatements(src, ref map);
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(null, src, map);
}
示例14: DebugWatch367_T39_Pass_2_lists_of_class_type_same_length_and_1_variable_of_class_type
public void DebugWatch367_T39_Pass_2_lists_of_class_type_same_length_and_1_variable_of_class_type()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
string src = @"class Integer
{
value : int;
constructor ValueCtor(_value : int)
{
value = _value;
}
}
def Sum : int(i1 : Integer, i2 : Integer, i3 : Integer)
{
return = i1.value + i2.value + i3.value;
}
list1 = {
Integer.ValueCtor(2),
Integer.ValueCtor(5),
Integer.ValueCtor(8)
};
list2 = {
Integer.ValueCtor(3),
Integer.ValueCtor(6),
Integer.ValueCtor(9)
};
list3 = Sum(list1, list2, Integer.ValueCtor(10)); // { 15, 21, 27 }";
WatchTestFx.GeneratePrintStatements(src, ref map);
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(null, src, map);
}
示例15: DebugWatch32_update
public void DebugWatch32_update()
{
Dictionary<int, List<string>> map = new Dictionary<int, List<string>>();
string src = @"
/*
a = 1;
b = a;
a = 10;
*/
/*
a = 1;
a = a + 1;
a = 10;
*/
/*
a = 1;
a = 10 + 20 * a;
a = 10;
*/
/*
a = 2;
x = 20;
y = 30;
a = x + y * a;
*/
/*
a = 2;
x = 20;
y = 30;
a = x * y + a;
*/
/*
def f : int(p : int)
{
return = p + 1;
}
a = 10;
b = f(a);
*/
/*
def doo : int()
{
d = 12;
return = d;
}
def f : int(p : int)
{
a = 10;
b = a;
a = p;
return = b;
}
x = 20;
y = f(x);
x = 40;
*/
/*
a = 10;
b = 20;
c = a < b ? a : b;
*/
/*
a = 5;
b = ++a;
*/";
WatchTestFx.GeneratePrintStatements(src, ref map);
WatchTestFx fx = new WatchTestFx(); fx.CompareRunAndWatchResults(null, src, map);
}