@@ -11,41 +11,41 @@ public class ValueRangeCompilerTest
11
11
[ Fact ]
12
12
public void WillCompileSingleTable ( )
13
13
{
14
- var a = new List < int > { 1 , 1 } ;
15
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ;
14
+ var a = new List < int > { 1 , 1 } ;
15
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ;
16
16
17
- result . ShouldBe ( new [ ] { 1 , 1 } ) ;
17
+ result . ShouldBe ( new [ ] { 1 , 1 } ) ;
18
18
}
19
19
20
20
[ Fact ]
21
21
public void WillSortSingleTable ( )
22
22
{
23
- var a = new List < int > { 3 , 7 , 18 , 22 , 1 , 1 , 9 , 13 } ;
24
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ;
23
+ var a = new List < int > { 3 , 7 , 18 , 22 , 1 , 1 , 9 , 13 } ;
24
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ;
25
25
26
- result . ShouldBe ( new [ ] { 1 , 1 , 3 , 7 , 9 , 13 , 18 , 22 } ) ;
26
+ result . ShouldBe ( new [ ] { 1 , 1 , 3 , 7 , 9 , 13 , 18 , 22 } ) ;
27
27
}
28
28
29
29
[ Fact ]
30
30
public void WillCompileTwoTables ( )
31
31
{
32
- var a = new List < int > { 3 , 7 , 22 , 25 } ;
33
- var b = new List < int > { 9 , 15 , 18 , 20 } ;
32
+ var a = new List < int > { 3 , 7 , 22 , 25 } ;
33
+ var b = new List < int > { 9 , 15 , 18 , 20 } ;
34
34
35
- var result = ValueRangeCompiler . Compile ( new [ ] { a , b } , new int [ 0 ] , new int [ 0 ] ) ;
36
- result . ShouldBe ( new [ ] { 3 , 7 , 9 , 15 , 18 , 20 , 22 , 25 } ) ;
35
+ var result = ValueRangeCompiler . Compile ( new [ ] { a , b } , new int [ 0 ] , new int [ 0 ] ) ;
36
+ result . ShouldBe ( new [ ] { 3 , 7 , 9 , 15 , 18 , 20 , 22 , 25 } ) ;
37
37
}
38
38
39
39
[ Fact ]
40
40
public void WillCombineTablesOfDifferentLengths ( )
41
41
{
42
- var a = new List < int > { 1 , 2 } ;
43
- var b = new List < int > { 75 , 75 , 42 , 46 , 13 , 15 } ;
44
- var c = new List < int > { 33 , 35 , 77 , 79 } ;
45
- var d = new List < int > { 4 , 10 , 99 , 99 , 101 , 105 , 303 , 307 } ;
42
+ var a = new List < int > { 1 , 2 } ;
43
+ var b = new List < int > { 75 , 75 , 42 , 46 , 13 , 15 } ;
44
+ var c = new List < int > { 33 , 35 , 77 , 79 } ;
45
+ var d = new List < int > { 4 , 10 , 99 , 99 , 101 , 105 , 303 , 307 } ;
46
46
47
- var result = ValueRangeCompiler . Compile ( new [ ] { a , b , c , d } , new int [ 0 ] , new int [ 0 ] ) ;
48
- result . ShouldBe ( new [ ] { 1 , 2 , 4 , 10 , 13 , 15 , 33 , 35 , 42 , 46 , 75 , 75 , 77 , 79 , 99 , 99 , 101 , 105 , 303 , 307 } ) ;
47
+ var result = ValueRangeCompiler . Compile ( new [ ] { a , b , c , d } , new int [ 0 ] , new int [ 0 ] ) ;
48
+ result . ShouldBe ( new [ ] { 1 , 2 , 4 , 10 , 13 , 15 , 33 , 35 , 42 , 46 , 75 , 75 , 77 , 79 , 99 , 99 , 101 , 105 , 303 , 307 } ) ;
49
49
}
50
50
51
51
[ Fact ]
@@ -59,9 +59,9 @@ public void WillReduceOverlappingValueRanges()
59
59
15 , 18
60
60
} ;
61
61
62
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ;
62
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ;
63
63
result . ShouldBe (
64
- new [ ] { 1 , 12 , 14 , 18 } ) ;
64
+ new [ ] { 1 , 12 , 14 , 18 } ) ;
65
65
}
66
66
67
67
[ Fact ]
@@ -75,8 +75,8 @@ public void WillReduceInclusiveValueRanges()
75
75
33 , 75
76
76
} ;
77
77
78
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ;
79
- result . ShouldBe ( new [ ] { 1 , 100 } ) ;
78
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ;
79
+ result . ShouldBe ( new [ ] { 1 , 100 } ) ;
80
80
}
81
81
82
82
[ Fact ]
@@ -90,8 +90,8 @@ public void WillReduceAdjacentValueRanges()
90
90
48 , 50
91
91
} ;
92
92
93
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ;
94
- result . ShouldBe ( new [ ] { 1 , 50 } ) ;
93
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ;
94
+ result . ShouldBe ( new [ ] { 1 , 50 } ) ;
95
95
}
96
96
97
97
[ Fact ]
@@ -102,8 +102,8 @@ public void WillIncludeValueRangesAfterBaseTable()
102
102
1 , 5
103
103
} ;
104
104
105
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new [ ] { 10 , 10 } , new int [ 0 ] ) ;
106
- result . ShouldBe ( new [ ] { 1 , 5 , 10 , 10 } ) ;
105
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new [ ] { 10 , 10 } , new int [ 0 ] ) ;
106
+ result . ShouldBe ( new [ ] { 1 , 5 , 10 , 10 } ) ;
107
107
}
108
108
109
109
[ Fact ]
@@ -114,8 +114,8 @@ public void WillIncludeMultipleValueRangesAfterBaseTable()
114
114
1 , 5
115
115
} ;
116
116
117
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new [ ] { 10 , 10 , 15 , 20 } , new int [ 0 ] ) ;
118
- result . ShouldBe ( new [ ] { 1 , 5 , 10 , 10 , 15 , 20 } ) ;
117
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new [ ] { 10 , 10 , 15 , 20 } , new int [ 0 ] ) ;
118
+ result . ShouldBe ( new [ ] { 1 , 5 , 10 , 10 , 15 , 20 } ) ;
119
119
}
120
120
121
121
[ Fact ]
@@ -126,8 +126,8 @@ public void WillIncludeValueRangesBeforeBaseTable()
126
126
15 , 20
127
127
} ;
128
128
129
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new [ ] { 4 , 7 } , new int [ 0 ] ) ;
130
- result . ShouldBe ( new [ ] { 4 , 7 , 15 , 20 } ) ;
129
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new [ ] { 4 , 7 } , new int [ 0 ] ) ;
130
+ result . ShouldBe ( new [ ] { 4 , 7 , 15 , 20 } ) ;
131
131
}
132
132
133
133
[ Fact ]
@@ -138,8 +138,8 @@ public void WillIncludeMultipleValueRangesBeforeBaseTable()
138
138
15 , 20
139
139
} ;
140
140
141
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new [ ] { 1 , 1 , 4 , 7 } , new int [ 0 ] ) ;
142
- result . ShouldBe ( new [ ] { 1 , 1 , 4 , 7 , 15 , 20 } ) ;
141
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new [ ] { 1 , 1 , 4 , 7 } , new int [ 0 ] ) ;
142
+ result . ShouldBe ( new [ ] { 1 , 1 , 4 , 7 , 15 , 20 } ) ;
143
143
}
144
144
145
145
[ Fact ]
@@ -150,8 +150,8 @@ public void WillRemoveValueRangeEqualToStartValue()
150
150
10 , 20
151
151
} ;
152
152
153
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new [ ] { 10 , 15 } ) ;
154
- result . ShouldBe ( new [ ] { 16 , 20 } ) ;
153
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new [ ] { 10 , 15 } ) ;
154
+ result . ShouldBe ( new [ ] { 16 , 20 } ) ;
155
155
}
156
156
157
157
[ Fact ]
@@ -162,8 +162,8 @@ public void WillRemoveValueRangeEqualToEndValue()
162
162
10 , 20
163
163
} ;
164
164
165
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new [ ] { 15 , 20 } ) ;
166
- result . ShouldBe ( new [ ] { 10 , 14 } ) ;
165
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new [ ] { 15 , 20 } ) ;
166
+ result . ShouldBe ( new [ ] { 10 , 14 } ) ;
167
167
}
168
168
169
169
[ Fact ]
@@ -174,8 +174,8 @@ public void WillRemoveValueRangeOverlappingStartValue()
174
174
10 , 20
175
175
} ;
176
176
177
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new [ ] { 5 , 15 } ) ;
178
- result . ShouldBe ( new [ ] { 16 , 20 } ) ;
177
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new [ ] { 5 , 15 } ) ;
178
+ result . ShouldBe ( new [ ] { 16 , 20 } ) ;
179
179
}
180
180
181
181
[ Fact ]
@@ -187,8 +187,8 @@ public void WillRemoveValueRangeOverlappingStartValueOnLaterRanges()
187
187
30 , 40
188
188
} ;
189
189
190
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new [ ] { 25 , 35 } ) ;
191
- result . ShouldBe ( new [ ] { 10 , 20 , 36 , 40 } ) ;
190
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new [ ] { 25 , 35 } ) ;
191
+ result . ShouldBe ( new [ ] { 10 , 20 , 36 , 40 } ) ;
192
192
}
193
193
194
194
[ Fact ]
@@ -199,8 +199,8 @@ public void WillRemoveValueRangeOverlappingEndValue()
199
199
10 , 20
200
200
} ;
201
201
202
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new [ ] { 15 , 25 } ) ;
203
- result . ShouldBe ( new [ ] { 10 , 14 } ) ;
202
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new [ ] { 15 , 25 } ) ;
203
+ result . ShouldBe ( new [ ] { 10 , 14 } ) ;
204
204
}
205
205
206
206
[ Fact ]
@@ -212,8 +212,8 @@ public void WillRemoveValueRangeOverlappingEndValueOnEarlierRanges()
212
212
30 , 40
213
213
} ;
214
214
215
- var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new [ ] { 15 , 25 } ) ;
216
- result . ShouldBe ( new [ ] { 10 , 14 , 30 , 40 } ) ;
215
+ var result = ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new [ ] { 15 , 25 } ) ;
216
+ result . ShouldBe ( new [ ] { 10 , 14 , 30 , 40 } ) ;
217
217
}
218
218
219
219
[ Fact ]
@@ -224,7 +224,7 @@ public void ThrowsForInvalidRange()
224
224
7 , 5
225
225
} ;
226
226
227
- Should . Throw < ArgumentException > ( ( ) => { ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ; } ) ;
227
+ Should . Throw < ArgumentException > ( ( ) => { ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ; } ) ;
228
228
}
229
229
230
230
[ Fact ]
@@ -236,7 +236,7 @@ public void ThrowsForOddLengthArray()
236
236
4
237
237
} ;
238
238
239
- Should . Throw < ArgumentException > ( ( ) => { ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ; } ) ;
239
+ Should . Throw < ArgumentException > ( ( ) => { ValueRangeCompiler . Compile ( new [ ] { a } , new int [ 0 ] , new int [ 0 ] ) ; } ) ;
240
240
}
241
241
}
242
242
}
0 commit comments