5
5
using System . Text . RegularExpressions ;
6
6
using NHibernate . Dialect ;
7
7
using NHibernate . DomainModel . Northwind . Entities ;
8
+ using NHibernate . Driver ;
8
9
using NHibernate . Linq ;
9
10
using NUnit . Framework ;
10
11
@@ -533,6 +534,10 @@ public void GroupByComputedValue()
533
534
{
534
535
if ( Dialect is FirebirdDialect )
535
536
Assert . Ignore ( "Firebird does not support complex group by expressions" ) ;
537
+ if ( sessions . ConnectionProvider . Driver is OdbcDriver )
538
+ Assert . Ignore ( "SQL Server seems unable to match complex group by and select list arguments when running over ODBC." ) ;
539
+ if ( Dialect is MsSqlCeDialect )
540
+ Assert . Ignore ( "SQL Server CE does not support complex group by expressions." ) ;
536
541
537
542
var orderGroups = db . Orders . GroupBy ( o => o . Customer . CustomerId == null ? 0 : 1 ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
538
543
Assert . AreEqual ( 830 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -543,6 +548,10 @@ public void GroupByComputedValueInAnonymousType()
543
548
{
544
549
if ( Dialect is FirebirdDialect )
545
550
Assert . Ignore ( "Firebird does not support complex group by expressions" ) ;
551
+ if ( sessions . ConnectionProvider . Driver is OdbcDriver )
552
+ Assert . Ignore ( "SQL Server seems unable to match complex group by and select list arguments when running over ODBC." ) ;
553
+ if ( Dialect is MsSqlCeDialect )
554
+ Assert . Ignore ( "SQL Server CE does not support complex group by expressions." ) ;
546
555
547
556
var orderGroups = db . Orders . GroupBy ( o => new { Key = o . Customer . CustomerId == null ? 0 : 1 } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
548
557
Assert . AreEqual ( 830 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -553,6 +562,10 @@ public void GroupByComputedValueInObjectArray()
553
562
{
554
563
if ( Dialect is FirebirdDialect )
555
564
Assert . Ignore ( "Firebird does not support complex group by expressions" ) ;
565
+ if ( sessions . ConnectionProvider . Driver is OdbcDriver )
566
+ Assert . Ignore ( "SQL Server seems unable to match complex group by and select list arguments when running over ODBC." ) ;
567
+ if ( Dialect is MsSqlCeDialect )
568
+ Assert . Ignore ( "SQL Server CE does not support complex group by expressions." ) ;
556
569
557
570
var orderGroups = db . Orders . GroupBy ( o => new [ ] { o . Customer . CustomerId == null ? 0 : 1 , } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
558
571
Assert . AreEqual ( 830 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -680,6 +693,10 @@ public void GroupByComputedValueWithJoinOnObject()
680
693
{
681
694
if ( Dialect is FirebirdDialect )
682
695
Assert . Ignore ( "Firebird does not support complex group by expressions" ) ;
696
+ if ( sessions . ConnectionProvider . Driver is OdbcDriver )
697
+ Assert . Ignore ( "SQL Server seems unable to match complex group by and select list arguments when running over ODBC." ) ;
698
+ if ( Dialect is MsSqlCeDialect )
699
+ Assert . Ignore ( "SQL Server CE does not support complex group by expressions." ) ;
683
700
684
701
var orderGroups = db . OrderLines . GroupBy ( o => o . Order . Customer == null ? 0 : 1 ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
685
702
Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -690,6 +707,10 @@ public void GroupByComputedValueWithJoinOnId()
690
707
{
691
708
if ( Dialect is FirebirdDialect )
692
709
Assert . Ignore ( "Firebird does not support complex group by expressions" ) ;
710
+ if ( sessions . ConnectionProvider . Driver is OdbcDriver )
711
+ Assert . Ignore ( "SQL Server seems unable to match complex group by and select list arguments when running over ODBC." ) ;
712
+ if ( Dialect is MsSqlCeDialect )
713
+ Assert . Ignore ( "SQL Server CE does not support complex group by expressions." ) ;
693
714
694
715
var orderGroups = db . OrderLines . GroupBy ( o => o . Order . Customer . CustomerId == null ? 0 : 1 ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
695
716
Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -700,6 +721,10 @@ public void GroupByComputedValueInAnonymousTypeWithJoinOnObject()
700
721
{
701
722
if ( Dialect is FirebirdDialect )
702
723
Assert . Ignore ( "Firebird does not support complex group by expressions" ) ;
724
+ if ( sessions . ConnectionProvider . Driver is OdbcDriver )
725
+ Assert . Ignore ( "SQL Server seems unable to match complex group by and select list arguments when running over ODBC." ) ;
726
+ if ( Dialect is MsSqlCeDialect )
727
+ Assert . Ignore ( "SQL Server CE does not support complex group by expressions." ) ;
703
728
704
729
var orderGroups = db . OrderLines . GroupBy ( o => new { Key = o . Order . Customer == null ? 0 : 1 } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
705
730
Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -710,6 +735,10 @@ public void GroupByComputedValueInAnonymousTypeWithJoinOnId()
710
735
{
711
736
if ( Dialect is FirebirdDialect )
712
737
Assert . Ignore ( "Firebird does not support complex group by expressions" ) ;
738
+ if ( sessions . ConnectionProvider . Driver is OdbcDriver )
739
+ Assert . Ignore ( "SQL Server seems unable to match complex group by and select list arguments when running over ODBC." ) ;
740
+ if ( Dialect is MsSqlCeDialect )
741
+ Assert . Ignore ( "SQL Server CE does not support complex group by expressions." ) ;
713
742
714
743
var orderGroups = db . OrderLines . GroupBy ( o => new { Key = o . Order . Customer . CustomerId == null ? 0 : 1 } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
715
744
Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -720,6 +749,10 @@ public void GroupByComputedValueInObjectArrayWithJoinOnObject()
720
749
{
721
750
if ( Dialect is FirebirdDialect )
722
751
Assert . Ignore ( "Firebird does not support complex group by expressions" ) ;
752
+ if ( sessions . ConnectionProvider . Driver is OdbcDriver )
753
+ Assert . Ignore ( "SQL Server seems unable to match complex group by and select list arguments when running over ODBC." ) ;
754
+ if ( Dialect is MsSqlCeDialect )
755
+ Assert . Ignore ( "SQL Server CE does not support complex group by expressions." ) ;
723
756
724
757
var orderGroups = db . OrderLines . GroupBy ( o => new [ ] { o . Order . Customer == null ? 0 : 1 } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
725
758
Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -730,6 +763,10 @@ public void GroupByComputedValueInObjectArrayWithJoinOnId()
730
763
{
731
764
if ( Dialect is FirebirdDialect )
732
765
Assert . Ignore ( "Firebird does not support complex group by expressions" ) ;
766
+ if ( sessions . ConnectionProvider . Driver is OdbcDriver )
767
+ Assert . Ignore ( "SQL Server seems unable to match complex group by and select list arguments when running over ODBC." ) ;
768
+ if ( Dialect is MsSqlCeDialect )
769
+ Assert . Ignore ( "SQL Server CE does not support complex group by expressions." ) ;
733
770
734
771
var orderGroups = db . OrderLines . GroupBy ( o => new [ ] { o . Order . Customer . CustomerId == null ? 0 : 1 } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
735
772
Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -740,6 +777,10 @@ public void GroupByComputedValueInObjectArrayWithJoinInRightSideOfCase()
740
777
{
741
778
if ( Dialect is FirebirdDialect )
742
779
Assert . Ignore ( "Firebird does not support complex group by expressions" ) ;
780
+ if ( sessions . ConnectionProvider . Driver is OdbcDriver )
781
+ Assert . Ignore ( "SQL Server seems unable to match complex group by and select list arguments when running over ODBC." ) ;
782
+ if ( Dialect is MsSqlCeDialect )
783
+ Assert . Ignore ( "SQL Server CE does not support complex group by expressions." ) ;
743
784
744
785
var orderGroups = db . OrderLines . GroupBy ( o => new [ ] { o . Order . Customer . CustomerId == null ? "unknown" : o . Order . Customer . CompanyName } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
745
786
Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -750,6 +791,10 @@ public void GroupByComputedValueFromNestedArraySelect()
750
791
{
751
792
if ( Dialect is FirebirdDialect )
752
793
Assert . Ignore ( "Firebird does not support complex group by expressions" ) ;
794
+ if ( sessions . ConnectionProvider . Driver is OdbcDriver )
795
+ Assert . Ignore ( "SQL Server seems unable to match complex group by and select list arguments when running over ODBC." ) ;
796
+ if ( Dialect is MsSqlCeDialect )
797
+ Assert . Ignore ( "SQL Server CE does not support complex group by expressions." ) ;
753
798
754
799
var orderGroups = db . OrderLines . Select ( o => new object [ ] { o } ) . GroupBy ( x => new object [ ] { ( ( OrderLine ) x [ 0 ] ) . Order . Customer == null ? 0 : 1 } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
755
800
Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -760,6 +805,10 @@ public void GroupByComputedValueFromNestedObjectSelect()
760
805
{
761
806
if ( Dialect is FirebirdDialect )
762
807
Assert . Ignore ( "Firebird does not support complex group by expressions" ) ;
808
+ if ( sessions . ConnectionProvider . Driver is OdbcDriver )
809
+ Assert . Ignore ( "SQL Server seems unable to match complex group by and select list arguments when running over ODBC." ) ;
810
+ if ( Dialect is MsSqlCeDialect )
811
+ Assert . Ignore ( "SQL Server CE does not support complex group by expressions." ) ;
763
812
764
813
var orderGroups = db . OrderLines . Select ( o => new { OrderLine = ( object ) o } ) . GroupBy ( x => new object [ ] { ( ( OrderLine ) x . OrderLine ) . Order . Customer == null ? 0 : 1 } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
765
814
Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
0 commit comments