@@ -33,7 +33,7 @@ public void CqlDate_Subtract_Months_From_Year()
33
33
{
34
34
Assert . IsTrue ( CqlDateTime . TryParse ( "2014" , out var baseDate ) ) ;
35
35
var result = baseDate . Subtract ( new CqlQuantity ( 25m , "month" ) ) ;
36
- Assert . AreEqual ( 2011 , result . Value . Year ) ;
36
+ Assert . AreEqual ( 2016 , result . Value . Year ) ;
37
37
Assert . AreEqual ( DateTimePrecision . Year , result . Precision ) ;
38
38
}
39
39
@@ -3587,7 +3587,7 @@ public void Add_Date_Quantity_To_MaxDate()
3587
3587
{
3588
3588
var rc = GetNewContext ( ) ;
3589
3589
var fcq = rc . Operators ;
3590
-
3590
+
3591
3591
var quantity = new CqlQuantity ( 1 , "day" ) ;
3592
3592
var inputDateMaxValue = CqlDate . MaxValue ;
3593
3593
var newDateAddMax = fcq . Add ( inputDateMaxValue , quantity ) ;
@@ -3637,7 +3637,7 @@ public void Add_Integer_To_MaxInteger()
3637
3637
{
3638
3638
var rc = GetNewContext ( ) ;
3639
3639
var fcq = rc . Operators ;
3640
-
3640
+
3641
3641
var addedValue = fcq . Add ( int . MaxValue , 1 ) ;
3642
3642
Assert . IsNull ( addedValue ) ;
3643
3643
}
@@ -3751,17 +3751,17 @@ public void Subtract_Decimal_To_MinDecimal()
3751
3751
var subtractedValue = fcq . Subtract ( decimal . MinValue , 1m ) ;
3752
3752
Assert . IsNull ( subtractedValue ) ;
3753
3753
}
3754
-
3754
+
3755
3755
#region Slice tests
3756
3756
3757
- /* Refer http://cql.hl7.org/09-b-cqlreference.html for operation details on Skip, Tail and Take cql operators
3757
+ /* Refer http://cql.hl7.org/09-b-cqlreference.html for operation details on Skip, Tail and Take cql operators
3758
3758
* These CQL operators uses Slice semantics from http://cql.hl7.org/04-logicalspecification.html#slice
3759
3759
*/
3760
3760
3761
3761
[ TestMethod ]
3762
3762
public void SliceSkip2 ( )
3763
3763
{
3764
- //The Skip operator returns the elements in the list, skipping the first number elements.
3764
+ //The Skip operator returns the elements in the list, skipping the first number elements.
3765
3765
//define "Skip2": Skip({ 1, 2, 3, 4, 5 }, 2) // { 3, 4, 5 }
3766
3766
var rtx = GetNewContext ( ) ;
3767
3767
var inputList = new List < int > { 1 , 2 , 3 , 4 , 5 } ;
@@ -3783,7 +3783,7 @@ public void SliceSkipNull()
3783
3783
Assert . IsNotNull ( slicedList ) ;
3784
3784
CollectionAssert . AreEqual ( expectedList , slicedList . ToList ( ) ) ;
3785
3785
}
3786
-
3786
+
3787
3787
[ TestMethod ]
3788
3788
public void SliceSkipEmpty ( )
3789
3789
{
@@ -3796,7 +3796,7 @@ public void SliceSkipEmpty()
3796
3796
Assert . IsNotNull ( slicedList ) ;
3797
3797
CollectionAssert . AreEqual ( expectedList , slicedList . ToList ( ) ) ;
3798
3798
}
3799
-
3799
+
3800
3800
[ TestMethod ]
3801
3801
public void SliceSkipIsNull ( )
3802
3802
{
@@ -3824,7 +3824,7 @@ public void SliceSkipZero()
3824
3824
[ TestMethod ]
3825
3825
public void SliceTail234 ( )
3826
3826
{
3827
- //The Tail operator returns all but the first element from the given list.
3827
+ //The Tail operator returns all but the first element from the given list.
3828
3828
//define "Tail234": Tail({ 1, 2, 3, 4 }) // { 2, 3, 4 }
3829
3829
var rtx = GetNewContext ( ) ;
3830
3830
var inputList = new List < int > { 1 , 2 , 3 , 4 } ;
@@ -3833,7 +3833,7 @@ public void SliceTail234()
3833
3833
Assert . IsNotNull ( slicedList ) ;
3834
3834
CollectionAssert . AreEqual ( expectedList , slicedList . ToList ( ) ) ;
3835
3835
}
3836
-
3836
+
3837
3837
[ TestMethod ]
3838
3838
public void SliceTailEmpty ( )
3839
3839
{
@@ -3846,7 +3846,7 @@ public void SliceTailEmpty()
3846
3846
Assert . IsNotNull ( slicedList ) ;
3847
3847
CollectionAssert . AreEqual ( expectedList , slicedList . ToList ( ) ) ;
3848
3848
}
3849
-
3849
+
3850
3850
[ TestMethod ]
3851
3851
public void SliceTailIsNull ( )
3852
3852
{
@@ -3859,7 +3859,7 @@ public void SliceTailIsNull()
3859
3859
Assert . IsNull ( slicedList ) ;
3860
3860
Assert . AreEqual ( expectedList , slicedList ) ;
3861
3861
}
3862
-
3862
+
3863
3863
[ TestMethod ]
3864
3864
public void SliceTake2 ( )
3865
3865
{
@@ -3872,7 +3872,7 @@ public void SliceTake2()
3872
3872
Assert . IsNotNull ( slicedList ) ;
3873
3873
CollectionAssert . AreEqual ( expectedList , slicedList . ToList ( ) ) ;
3874
3874
}
3875
-
3875
+
3876
3876
[ TestMethod ]
3877
3877
public void SliceTakeTooMany ( )
3878
3878
{
@@ -3885,7 +3885,7 @@ public void SliceTakeTooMany()
3885
3885
Assert . IsNotNull ( slicedList ) ;
3886
3886
CollectionAssert . AreEqual ( expectedList , slicedList . ToList ( ) ) ;
3887
3887
}
3888
-
3888
+
3889
3889
[ TestMethod ]
3890
3890
public void SliceTakeEmpty ( )
3891
3891
{
@@ -3898,7 +3898,7 @@ public void SliceTakeEmpty()
3898
3898
Assert . IsNotNull ( slicedList ) ;
3899
3899
CollectionAssert . AreEqual ( expectedList , slicedList . ToList ( ) ) ;
3900
3900
}
3901
-
3901
+
3902
3902
[ TestMethod ]
3903
3903
public void SliceTakeIsNull ( )
3904
3904
{
@@ -3920,12 +3920,12 @@ public void SliceEmptyEnumerableWithIEnumerableNotCollection()
3920
3920
var rtx = GetNewContext ( ) ;
3921
3921
var inputEnumerable = Enumerable . Empty < int > ( ) . Where ( x => true ) ; // Creates IEnumerable<int> not a collection
3922
3922
var expectedList = new List < int > ( ) ;
3923
-
3923
+
3924
3924
// Test various slice operations on empty enumerable
3925
3925
var slicedList1 = rtx . Operators . Slice ( inputEnumerable , 0 , 5 ) ;
3926
3926
var slicedList2 = rtx . Operators . Slice ( inputEnumerable , 2 , null ) ;
3927
3927
var slicedList3 = rtx . Operators . Slice ( inputEnumerable , null , null ) ;
3928
-
3928
+
3929
3929
Assert . IsNotNull ( slicedList1 ) ;
3930
3930
Assert . IsNotNull ( slicedList2 ) ;
3931
3931
Assert . IsNotNull ( slicedList3 ) ;
0 commit comments