55using System . Text . RegularExpressions ;
66using NHibernate . Dialect ;
77using NHibernate . DomainModel . Northwind . Entities ;
8+ using NHibernate . Driver ;
89using NHibernate . Linq ;
910using NUnit . Framework ;
1011
@@ -533,6 +534,10 @@ public void GroupByComputedValue()
533534 {
534535 if ( Dialect is FirebirdDialect )
535536 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." ) ;
536541
537542 var orderGroups = db . Orders . GroupBy ( o => o . Customer . CustomerId == null ? 0 : 1 ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
538543 Assert . AreEqual ( 830 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -543,6 +548,10 @@ public void GroupByComputedValueInAnonymousType()
543548 {
544549 if ( Dialect is FirebirdDialect )
545550 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." ) ;
546555
547556 var orderGroups = db . Orders . GroupBy ( o => new { Key = o . Customer . CustomerId == null ? 0 : 1 } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
548557 Assert . AreEqual ( 830 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -553,6 +562,10 @@ public void GroupByComputedValueInObjectArray()
553562 {
554563 if ( Dialect is FirebirdDialect )
555564 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." ) ;
556569
557570 var orderGroups = db . Orders . GroupBy ( o => new [ ] { o . Customer . CustomerId == null ? 0 : 1 , } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
558571 Assert . AreEqual ( 830 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -680,6 +693,10 @@ public void GroupByComputedValueWithJoinOnObject()
680693 {
681694 if ( Dialect is FirebirdDialect )
682695 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." ) ;
683700
684701 var orderGroups = db . OrderLines . GroupBy ( o => o . Order . Customer == null ? 0 : 1 ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
685702 Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -690,6 +707,10 @@ public void GroupByComputedValueWithJoinOnId()
690707 {
691708 if ( Dialect is FirebirdDialect )
692709 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." ) ;
693714
694715 var orderGroups = db . OrderLines . GroupBy ( o => o . Order . Customer . CustomerId == null ? 0 : 1 ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
695716 Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -700,6 +721,10 @@ public void GroupByComputedValueInAnonymousTypeWithJoinOnObject()
700721 {
701722 if ( Dialect is FirebirdDialect )
702723 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." ) ;
703728
704729 var orderGroups = db . OrderLines . GroupBy ( o => new { Key = o . Order . Customer == null ? 0 : 1 } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
705730 Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -710,6 +735,10 @@ public void GroupByComputedValueInAnonymousTypeWithJoinOnId()
710735 {
711736 if ( Dialect is FirebirdDialect )
712737 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." ) ;
713742
714743 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 ( ) ;
715744 Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -720,6 +749,10 @@ public void GroupByComputedValueInObjectArrayWithJoinOnObject()
720749 {
721750 if ( Dialect is FirebirdDialect )
722751 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." ) ;
723756
724757 var orderGroups = db . OrderLines . GroupBy ( o => new [ ] { o . Order . Customer == null ? 0 : 1 } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
725758 Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -730,6 +763,10 @@ public void GroupByComputedValueInObjectArrayWithJoinOnId()
730763 {
731764 if ( Dialect is FirebirdDialect )
732765 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." ) ;
733770
734771 var orderGroups = db . OrderLines . GroupBy ( o => new [ ] { o . Order . Customer . CustomerId == null ? 0 : 1 } ) . Select ( g => new { Key = g . Key , Count = g . Count ( ) } ) . ToList ( ) ;
735772 Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -740,6 +777,10 @@ public void GroupByComputedValueInObjectArrayWithJoinInRightSideOfCase()
740777 {
741778 if ( Dialect is FirebirdDialect )
742779 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." ) ;
743784
744785 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 ( ) ;
745786 Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -750,6 +791,10 @@ public void GroupByComputedValueFromNestedArraySelect()
750791 {
751792 if ( Dialect is FirebirdDialect )
752793 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." ) ;
753798
754799 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 ( ) ;
755800 Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
@@ -760,6 +805,10 @@ public void GroupByComputedValueFromNestedObjectSelect()
760805 {
761806 if ( Dialect is FirebirdDialect )
762807 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." ) ;
763812
764813 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 ( ) ;
765814 Assert . AreEqual ( 2155 , orderGroups . Sum ( g => g . Count ) ) ;
0 commit comments