Skip to content

Commit d9bac12

Browse files
committed
NH-2167, NH-3609, NH-3797, NH-3801, NH-3844 - Disable tests not supported by Firebird
1 parent 7e83aff commit d9bac12

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

src/NHibernate.Test/Linq/ByMethod/GroupByTests.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,20 +531,29 @@ into grp
531531
[Test(Description = "NH-3797")]
532532
public void GroupByComputedValue()
533533
{
534+
if (Dialect is FirebirdDialect)
535+
Assert.Ignore("Firebird does not support complex group by expressions");
536+
534537
var orderGroups = db.Orders.GroupBy(o => o.Customer.CustomerId == null ? 0 : 1).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
535538
Assert.AreEqual(830, orderGroups.Sum(g => g.Count));
536539
}
537540

538541
[Test(Description = "NH-3797")]
539542
public void GroupByComputedValueInAnonymousType()
540543
{
544+
if (Dialect is FirebirdDialect)
545+
Assert.Ignore("Firebird does not support complex group by expressions");
546+
541547
var orderGroups = db.Orders.GroupBy(o => new { Key = o.Customer.CustomerId == null ? 0 : 1 }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
542548
Assert.AreEqual(830, orderGroups.Sum(g => g.Count));
543549
}
544550

545551
[Test(Description = "NH-3797")]
546552
public void GroupByComputedValueInObjectArray()
547553
{
554+
if (Dialect is FirebirdDialect)
555+
Assert.Ignore("Firebird does not support complex group by expressions");
556+
548557
var orderGroups = db.Orders.GroupBy(o => new[] { o.Customer.CustomerId == null ? 0 : 1, }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
549558
Assert.AreEqual(830, orderGroups.Sum(g => g.Count));
550559
}
@@ -669,62 +678,89 @@ public void GroupByKeyWithConstantFromVariable()
669678
[Test(Description = "NH-3801")]
670679
public void GroupByComputedValueWithJoinOnObject()
671680
{
681+
if (Dialect is FirebirdDialect)
682+
Assert.Ignore("Firebird does not support complex group by expressions");
683+
672684
var orderGroups = db.OrderLines.GroupBy(o => o.Order.Customer == null ? 0 : 1).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
673685
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
674686
}
675687

676688
[Test(Description = "NH-3801")]
677689
public void GroupByComputedValueWithJoinOnId()
678690
{
691+
if (Dialect is FirebirdDialect)
692+
Assert.Ignore("Firebird does not support complex group by expressions");
693+
679694
var orderGroups = db.OrderLines.GroupBy(o => o.Order.Customer.CustomerId == null ? 0 : 1).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
680695
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
681696
}
682697

683698
[Test(Description = "NH-3801")]
684699
public void GroupByComputedValueInAnonymousTypeWithJoinOnObject()
685700
{
701+
if (Dialect is FirebirdDialect)
702+
Assert.Ignore("Firebird does not support complex group by expressions");
703+
686704
var orderGroups = db.OrderLines.GroupBy(o => new { Key = o.Order.Customer == null ? 0 : 1 }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
687705
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
688706
}
689707

690708
[Test(Description = "NH-3801")]
691709
public void GroupByComputedValueInAnonymousTypeWithJoinOnId()
692710
{
711+
if (Dialect is FirebirdDialect)
712+
Assert.Ignore("Firebird does not support complex group by expressions");
713+
693714
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();
694715
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
695716
}
696717

697718
[Test(Description = "NH-3801")]
698719
public void GroupByComputedValueInObjectArrayWithJoinOnObject()
699720
{
721+
if (Dialect is FirebirdDialect)
722+
Assert.Ignore("Firebird does not support complex group by expressions");
723+
700724
var orderGroups = db.OrderLines.GroupBy(o => new[] { o.Order.Customer == null ? 0 : 1 }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
701725
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
702726
}
703727

704728
[Test(Description = "NH-3801")]
705729
public void GroupByComputedValueInObjectArrayWithJoinOnId()
706730
{
731+
if (Dialect is FirebirdDialect)
732+
Assert.Ignore("Firebird does not support complex group by expressions");
733+
707734
var orderGroups = db.OrderLines.GroupBy(o => new[] { o.Order.Customer.CustomerId == null ? 0 : 1 }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
708735
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
709736
}
710737

711738
[Test(Description = "NH-3801")]
712739
public void GroupByComputedValueInObjectArrayWithJoinInRightSideOfCase()
713740
{
741+
if (Dialect is FirebirdDialect)
742+
Assert.Ignore("Firebird does not support complex group by expressions");
743+
714744
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();
715745
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
716746
}
717747

718748
[Test(Description = "NH-3844")]
719749
public void GroupByComputedValueFromNestedArraySelect()
720750
{
751+
if (Dialect is FirebirdDialect)
752+
Assert.Ignore("Firebird does not support complex group by expressions");
753+
721754
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();
722755
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
723756
}
724757

725758
[Test(Description = "NH-3844")]
726759
public void GroupByComputedValueFromNestedObjectSelect()
727760
{
761+
if (Dialect is FirebirdDialect)
762+
Assert.Ignore("Firebird does not support complex group by expressions");
763+
728764
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();
729765
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
730766
}

src/NHibernate.Test/NHSpecificTest/NH2167/Fixture.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
using NHibernate.Cfg.MappingSchema;
22
using NHibernate.Criterion;
3+
using NHibernate.Dialect;
34
using NHibernate.Mapping.ByCode;
45
using NUnit.Framework;
56

67
namespace NHibernate.Test.NHSpecificTest.NH2167
78
{
89
public class Fixture : TestCaseMappingByCode
910
{
11+
protected override bool AppliesTo(Dialect.Dialect dialect)
12+
{
13+
return !(dialect is FirebirdDialect);
14+
}
15+
1016
protected override HbmMapping GetMappings()
1117
{
1218
var mapper = new ModelMapper();

src/NHibernate.Test/NHSpecificTest/NH3609/Fixture.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using NHibernate.Criterion;
2+
using NHibernate.Dialect;
23
using NHibernate.Transform;
34
using NUnit.Framework;
45

@@ -82,6 +83,9 @@ public void CountWithConditionalDoesNotThrow()
8283
[Test]
8384
public void GroupByClauseHasParameterSet()
8485
{
86+
if (Dialect is FirebirdDialect)
87+
Assert.Ignore("Firebird does not support complex group by expressions");
88+
8589
using (var session = OpenSession())
8690
using (session.BeginTransaction())
8791
{

src/NHibernate.Test/NHSpecificTest/NH3844/Fixture.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Reflection;
77
using System.Text;
88
using System.Threading;
9+
using NHibernate.Dialect;
910
using NHibernate.Linq;
1011
using NHibernate.Test.ExceptionsTest;
1112
using NHibernate.Test.MappingByCode;
@@ -16,6 +17,11 @@ namespace NHibernate.Test.NHSpecificTest.NH3844
1617
[TestFixture]
1718
public class Fixture : BugTestCase
1819
{
20+
protected override bool AppliesTo(Dialect.Dialect dialect)
21+
{
22+
return !(dialect is FirebirdDialect);
23+
}
24+
1925
protected override void OnSetUp()
2026
{
2127
var job1 = new Job { Name = "Not a Job", BillingType = BillingType.None };

0 commit comments

Comments
 (0)