Skip to content

Commit 4fa7095

Browse files
committed
Skip native guid tests for DB2
1 parent 1c64dd2 commit 4fa7095

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

src/NHibernate.Test/Async/IdGen/NativeGuid/NativeGuidFixture.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//------------------------------------------------------------------------------
99

1010

11+
using System;
1112
using System.Collections;
1213
using NUnit.Framework;
1314

@@ -27,6 +28,19 @@ protected override string[] Mappings
2728
get { return new[] {"IdGen.NativeGuid.NativeGuidPoid.hbm.xml"}; }
2829
}
2930

31+
protected override bool AppliesTo(Dialect.Dialect dialect)
32+
{
33+
try
34+
{
35+
var _ = dialect.SelectGUIDString;
36+
return true;
37+
}
38+
catch (NotSupportedException)
39+
{
40+
return false;
41+
}
42+
}
43+
3044
[Test]
3145
public async Task CrdAsync()
3246
{
@@ -51,4 +65,4 @@ public async Task CrdAsync()
5165
}
5266
}
5367
}
54-
}
68+
}

src/NHibernate.Test/Async/IdGen/NativeGuid/NativeGuidGeneratorFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ public async Task ReturnedValueIsGuidAsync()
3939
{
4040
try
4141
{
42-
var str = Dialect.Dialect.GetDialect().SelectGUIDString;
42+
var _ = sessions.Dialect.SelectGUIDString;
4343
}
4444
catch (NotSupportedException)
4545
{
46-
Assert.Ignore("This test does not apply to {0}", Dialect.Dialect.GetDialect());
46+
Assert.Ignore("This test does not apply to {0}", sessions.Dialect);
4747
}
4848

4949
var gen = new NativeGuidGenerator();

src/NHibernate.Test/IdGen/NativeGuid/NativeGuidFixture.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Collections;
23
using NUnit.Framework;
34

@@ -16,6 +17,19 @@ protected override string[] Mappings
1617
get { return new[] {"IdGen.NativeGuid.NativeGuidPoid.hbm.xml"}; }
1718
}
1819

20+
protected override bool AppliesTo(Dialect.Dialect dialect)
21+
{
22+
try
23+
{
24+
var _ = dialect.SelectGUIDString;
25+
return true;
26+
}
27+
catch (NotSupportedException)
28+
{
29+
return false;
30+
}
31+
}
32+
1933
[Test]
2034
public void Crd()
2135
{
@@ -40,4 +54,4 @@ public void Crd()
4054
}
4155
}
4256
}
43-
}
57+
}

src/NHibernate.Test/IdGen/NativeGuid/NativeGuidGeneratorFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public void ReturnedValueIsGuid()
2727
{
2828
try
2929
{
30-
var str = Dialect.Dialect.GetDialect().SelectGUIDString;
30+
var _ = sessions.Dialect.SelectGUIDString;
3131
}
3232
catch (NotSupportedException)
3333
{
34-
Assert.Ignore("This test does not apply to {0}", Dialect.Dialect.GetDialect());
34+
Assert.Ignore("This test does not apply to {0}", sessions.Dialect);
3535
}
3636

3737
var gen = new NativeGuidGenerator();

0 commit comments

Comments
 (0)