@@ -32,64 +32,64 @@ private static void TestAtomValueOperators()
32
32
33
33
left . Type = AttributeTypes . Char ;
34
34
right . Type = AttributeTypes . Char ;
35
- Assert . Equal ( false , ( left < right ) . BooleanValue ) ;
36
- Assert . Equal ( true , ( left > right ) . BooleanValue ) ;
37
- Assert . Equal ( false , ( left == right ) . BooleanValue ) ;
38
- Assert . Equal ( true , ( left != right ) . BooleanValue ) ;
39
- Assert . Equal ( false , ( left <= right ) . BooleanValue ) ;
40
- Assert . Equal ( true , ( left >= right ) . BooleanValue ) ;
35
+ Assert . False ( ( left < right ) . BooleanValue ) ;
36
+ Assert . True ( ( left > right ) . BooleanValue ) ;
37
+ Assert . False ( ( left == right ) . BooleanValue ) ;
38
+ Assert . True ( ( left != right ) . BooleanValue ) ;
39
+ Assert . False ( ( left <= right ) . BooleanValue ) ;
40
+ Assert . True ( ( left >= right ) . BooleanValue ) ;
41
41
Assert . Equal ( "abedebabeceb" , ( left + right ) . StringValue ) ;
42
42
43
43
left . Type = AttributeTypes . Int ;
44
44
right . Type = AttributeTypes . Int ;
45
- Assert . Equal ( true , ( left < right ) . BooleanValue ) ;
46
- Assert . Equal ( false , ( left > right ) . BooleanValue ) ;
47
- Assert . Equal ( false , ( left == right ) . BooleanValue ) ;
48
- Assert . Equal ( true , ( left != right ) . BooleanValue ) ;
49
- Assert . Equal ( true , ( left <= right ) . BooleanValue ) ;
50
- Assert . Equal ( false , ( left >= right ) . BooleanValue ) ;
45
+ Assert . True ( ( left < right ) . BooleanValue ) ;
46
+ Assert . False ( ( left > right ) . BooleanValue ) ;
47
+ Assert . False ( ( left == right ) . BooleanValue ) ;
48
+ Assert . True ( ( left != right ) . BooleanValue ) ;
49
+ Assert . True ( ( left <= right ) . BooleanValue ) ;
50
+ Assert . False ( ( left >= right ) . BooleanValue ) ;
51
51
Assert . Equal ( 628 , ( left + right ) . IntegerValue ) ;
52
52
Assert . Equal ( - 400 , ( left - right ) . IntegerValue ) ;
53
53
Assert . Equal ( 114 * 514 , ( left * right ) . IntegerValue ) ;
54
54
Assert . Equal ( 114 / 514 , ( left / right ) . IntegerValue ) ;
55
55
56
56
left . Type = AttributeTypes . Float ;
57
57
right . Type = AttributeTypes . Float ;
58
- Assert . Equal ( false , ( left < right ) . BooleanValue ) ;
59
- Assert . Equal ( false , ( left > right ) . BooleanValue ) ;
60
- Assert . Equal ( true , ( left == right ) . BooleanValue ) ;
61
- Assert . Equal ( false , ( left != right ) . BooleanValue ) ;
62
- Assert . Equal ( true , ( left <= right ) . BooleanValue ) ;
63
- Assert . Equal ( true , ( left >= right ) . BooleanValue ) ;
58
+ Assert . False ( ( left < right ) . BooleanValue ) ;
59
+ Assert . False ( ( left > right ) . BooleanValue ) ;
60
+ Assert . True ( ( left == right ) . BooleanValue ) ;
61
+ Assert . False ( ( left != right ) . BooleanValue ) ;
62
+ Assert . True ( ( left <= right ) . BooleanValue ) ;
63
+ Assert . True ( ( left >= right ) . BooleanValue ) ;
64
64
Assert . Equal ( 28.28 , ( left + right ) . FloatValue ) ;
65
- Assert . Equal ( 0.0 , ( left - right ) . FloatValue ) ;
65
+ Assert . Equal ( 0.0 , ( left - right ) . FloatValue ) ;
66
66
Assert . Equal ( 14.14 * 14.14 , ( left * right ) . FloatValue ) ;
67
67
Assert . Equal ( 1 , ( left / right ) . FloatValue ) ;
68
68
}
69
69
70
70
private static void TestExpression ( )
71
71
{
72
- TestAndList ( ) ;
72
+ TestAndList ( ) ;
73
73
TestCalculateSingleValue ( ) ;
74
74
TestFullCalculate ( ) ;
75
75
}
76
76
77
77
private static void TestFullCalculate ( )
78
78
{
79
79
Expression exp = GetAndsExpression ( ) ;
80
-
80
+
81
81
List < AttributeValue > nameValuePairs = new List < AttributeValue > ( ) ;
82
- nameValuePairs . Add ( new AttributeValue ( "a" , new AtomValue { Type = AttributeTypes . Int , IntegerValue = 33 } ) ) ;
83
- nameValuePairs . Add ( new AttributeValue ( "b" , new AtomValue { Type = AttributeTypes . Char , CharLimit = 5 , StringValue = "stc" } ) ) ;
84
- nameValuePairs . Add ( new AttributeValue ( "c" , new AtomValue { Type = AttributeTypes . Float , FloatValue = 6.0 } ) ) ;
82
+ nameValuePairs . Add ( new AttributeValue ( "a" , new AtomValue { Type = AttributeTypes . Int , IntegerValue = 33 } ) ) ;
83
+ nameValuePairs . Add ( new AttributeValue ( "b" , new AtomValue { Type = AttributeTypes . Char , CharLimit = 5 , StringValue = "stc" } ) ) ;
84
+ nameValuePairs . Add ( new AttributeValue ( "c" , new AtomValue { Type = AttributeTypes . Float , FloatValue = 6.0 } ) ) ;
85
85
86
86
AtomValue result = exp . Calculate ( nameValuePairs ) ;
87
- Assert . Equal ( true , result . BooleanValue ) ;
87
+ Assert . True ( result . BooleanValue ) ;
88
88
89
89
nameValuePairs [ 1 ] . Value . StringValue = "stz" ;
90
90
91
91
result = exp . Calculate ( nameValuePairs ) ;
92
- Assert . Equal ( false , result . BooleanValue ) ;
92
+ Assert . False ( result . BooleanValue ) ;
93
93
}
94
94
95
95
private static void TestCalculateSingleValue ( )
@@ -100,15 +100,15 @@ private static void TestCalculateSingleValue()
100
100
attributeValue . Type = AttributeTypes . Char ;
101
101
attributeValue . CharLimit = 10 ;
102
102
attributeValue . StringValue = "aaa" ;
103
- Assert . Equal ( true , andsExpression . CheckKey ( attributeName , attributeValue ) ) ;
103
+ Assert . True ( andsExpression . CheckKey ( attributeName , attributeValue ) ) ;
104
104
}
105
105
106
106
private static void TestAndList ( )
107
107
{
108
108
Expression andsExpression = GetAndsExpression ( ) ;
109
109
var andList = andsExpression . Ands ;
110
110
// "not equal" operator is ignored
111
- Assert . Equal ( false , andList . ContainsKey ( "a" ) ) ;
111
+ Assert . False ( andList . ContainsKey ( "a" ) ) ;
112
112
Assert . Equal ( Operator . LessThanOrEqualTo , andList [ "b" ] . Operator ) ;
113
113
Assert . Equal ( "str" , andList [ "b" ] . RightOperand . ConcreteValue . StringValue ) ;
114
114
Assert . Equal ( Operator . LessThan , andList [ "c" ] . Operator ) ;
0 commit comments