Skip to content

Commit 305c4dc

Browse files
committed
NH-3807 - Tests that don't work with distributed transactions in .NET core.
1 parent 180f39f commit 305c4dc

File tree

7 files changed

+21
-7
lines changed

7 files changed

+21
-7
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void Dispose_session_inside_transaction_scope()
7676
Assert.IsFalse(s.IsOpen);
7777
}
7878

79-
79+
#if !NETCOREAPP2_0
8080
[Test]
8181
public void When_commiting_items_in_DTC_transaction_will_add_items_to_2nd_level_cache()
8282
{
@@ -147,6 +147,7 @@ public void When_committing_transaction_scope_will_commit_transaction()
147147
tx.Commit();
148148
}
149149
}
150+
#endif
150151

151152
[Test]
152153
public void Will_not_save_when_flush_mode_is_never()
@@ -171,6 +172,7 @@ public void Will_not_save_when_flush_mode_is_never()
171172
}
172173
}
173174

175+
#if !NETCOREAPP2_0
174176
[Test]
175177
public void When_using_two_sessions_with_explicit_flush()
176178
{
@@ -248,5 +250,6 @@ public void When_using_two_sessions()
248250
tx.Commit();
249251
}
250252
}
253+
#endif
251254
}
252255
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace NHibernate.Test.NHSpecificTest.NH2057
77
[TestFixture]
88
public class Fixture : BugTestCase
99
{
10+
#if !NETCOREAPP2_0
1011
[Test]
1112
public void WillCloseWhenUsingDTC()
1213
{
@@ -25,5 +26,6 @@ public void WillCloseWhenUsingDTC()
2526
// following scope disposal. Sleep a bit for accounting for this.
2627
Assert.That(() => s.IsOpen, Is.False.After(500, 100));
2728
}
29+
#endif
2830
}
2931
}

src/NHibernate.Test/NHSpecificTest/NH3583/AutoFlushFixture.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public void ShouldAutoFlushWhenInExplicitTransaction()
4949
Assert.That(result.Count, Is.EqualTo(1));
5050
}
5151
}
52+
53+
#if !NETCOREAPP2_0
5254
[Test]
5355
public void ShouldAutoFlushWhenInDistributedTransaction()
5456
{
@@ -65,5 +67,6 @@ public void ShouldAutoFlushWhenInDistributedTransaction()
6567
Assert.That(result.Count, Is.EqualTo(1));
6668
}
6769
}
70+
#endif
6871
}
6972
}

src/NHibernate.Test/ReadOnly/ReadOnlyCriteriaQueryTest.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,8 @@ public void Subselect()
10521052
t.Commit();
10531053
}
10541054
}
1055-
1055+
1056+
#if !NETCOREAPP2_0
10561057
[Test]
10571058
public void DetachedCriteria()
10581059
{
@@ -1106,7 +1107,8 @@ public void DetachedCriteria()
11061107
t.Commit();
11071108
}
11081109
}
1109-
1110+
#endif
1111+
11101112
[Test]
11111113
public void TwoAliasesCache()
11121114
{

src/NHibernate.Test/SystemTransactions/TransactionFixture.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if !NETCOREAPP2_0
12
using System.Collections.Generic;
23
using System.Linq;
34
using System.Transactions;
@@ -106,4 +107,5 @@ public void FlushFromTransactionAppliesToSharingSession()
106107
}
107108
}
108109
}
109-
}
110+
}
111+
#endif

src/NHibernate.Test/SystemTransactions/TransactionNotificationFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void ShouldNotifyAfterDistributedTransaction(bool doCommit)
148148
Assert.That(interceptor.afterTransactionCompletionCalled, Is.EqualTo(2));
149149
}
150150

151-
151+
#if !NETCOREAPP2_0
152152
[Description("NH2128")]
153153
[Theory]
154154
public void ShouldNotifyAfterDistributedTransactionWithOwnConnection(bool doCommit)
@@ -184,6 +184,6 @@ public void ShouldNotifyAfterDistributedTransactionWithOwnConnection(bool doComm
184184

185185
Assert.That(interceptor.afterTransactionCompletionCalled, Is.EqualTo(1));
186186
}
187-
187+
#endif
188188
}
189189
}

src/NHibernate.Test/UtilityTest/ReflectHelperFixture.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public void NoTypeFoundReturnsNull()
8282
Assert.IsNull(noType);
8383
}
8484

85+
#if !NETCOREAPP2_0
8586
[Test]
8687
public void TypeFoundInNotLoadedAssembly()
8788
{
@@ -91,6 +92,7 @@ public void TypeFoundInNotLoadedAssembly()
9192
System.Type sameType = ReflectHelper.TypeFromAssembly("System.Web.HttpRequest", "System.Web", false);
9293
Assert.AreEqual(httpRequest, sameType, "should be the exact same Type");
9394
}
95+
#endif
9496

9597
[Test]
9698
public void SystemTypes()
@@ -185,4 +187,4 @@ public class MyImplementation: IMyInterface
185187
public string Name { get; set; }
186188
public string Description { get; set; }
187189
}
188-
}
190+
}

0 commit comments

Comments
 (0)