Skip to content

Commit a49f014

Browse files
committed
Changes xunit library dependency from v2.x to v3.x for ReactiveDomain.Testing class library.
1 parent adf8320 commit a49f014

File tree

3 files changed

+12
-24
lines changed

3 files changed

+12
-24
lines changed

src/ReactiveDomain.Testing/EventStore/StreamReaderTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Threading;
88
using System.Threading.Tasks;
99
using Xunit;
10-
using Xunit.Abstractions;
1110

1211
// ReSharper disable UnusedParameter.Local
1312

src/ReactiveDomain.Testing/ReactiveDomain.Testing.csproj

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,8 @@
1111
<None Remove="Domain\**" />
1212
</ItemGroup>
1313
<ItemGroup>
14-
<PackageReference Include="xunit" Version="2.9.2" />
1514
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
16-
<PackageReference Include="xunit.runner.console" Version="2.9.2">
17-
<PrivateAssets>all</PrivateAssets>
18-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19-
</PackageReference>
20-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
21-
<PrivateAssets>all</PrivateAssets>
22-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
23-
</PackageReference>
15+
<PackageReference Include="xunit.v3" Version="1.1.0" />
2416
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
2517
</ItemGroup>
2618
<ItemGroup>

src/ReactiveDomain.Testing/Specifications/TestQueueTests.cs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-

2-
3-
using ReactiveDomain.Messaging;
1+
using ReactiveDomain.Messaging;
42
using ReactiveDomain.Messaging.Bus;
53
using System;
6-
using System.Threading;
74
using System.Threading.Tasks;
85
using Xunit;
96

@@ -133,8 +130,8 @@ public void waiting_for_message_throws_on_clear()
133130
{
134131
using (var tq = new TestQueue(_dispatcher, new[] { typeof(Event), typeof(Command) }))
135132
{
136-
Task.Run(() => Assert.Throws<InvalidOperationException>(() => tq.WaitFor<TestEvent>(TimeSpan.FromMilliseconds(100))))
137-
.ContinueWith(t => tq.Clear());
133+
Task.Run(() => Assert.Throws<InvalidOperationException>(() => tq.WaitFor<TestEvent>(TimeSpan.FromMilliseconds(100))), TestContext.Current.CancellationToken)
134+
.ContinueWith(t => tq.Clear(), TestContext.Current.CancellationToken);
138135
tq.AssertEmpty();
139136
}
140137
}
@@ -143,8 +140,8 @@ public void waiting_for_id_throws_on_clear()
143140
{
144141
using (var tq = new TestQueue(_dispatcher, new[] { typeof(Event), typeof(Command) }))
145142
{
146-
Task.Run(() => Assert.Throws<InvalidOperationException>(() => tq.WaitForMsgId(Guid.NewGuid(), TimeSpan.FromMilliseconds(100))))
147-
.ContinueWith(t => tq.Clear());
143+
Task.Run(() => Assert.Throws<InvalidOperationException>(() => tq.WaitForMsgId(Guid.NewGuid(), TimeSpan.FromMilliseconds(100))), TestContext.Current.CancellationToken)
144+
.ContinueWith(t => tq.Clear(), TestContext.Current.CancellationToken);
148145
tq.AssertEmpty();
149146
}
150147
}
@@ -157,8 +154,8 @@ public void can_wait_for_a_specific_message()
157154
var evt = new TestEvent();
158155
var evt2 = new TestEvent();
159156
//before
160-
var t1 = Task.Run(() => tq.WaitForMsgId(evt.MsgId, TimeSpan.FromMilliseconds(1000)));
161-
var t2 = Task.Run(() => tq.WaitForMsgId(evt2.MsgId, TimeSpan.FromMilliseconds(1000)));
157+
var t1 = Task.Run(() => tq.WaitForMsgId(evt.MsgId, TimeSpan.FromMilliseconds(1000)), TestContext.Current.CancellationToken);
158+
var t2 = Task.Run(() => tq.WaitForMsgId(evt2.MsgId, TimeSpan.FromMilliseconds(1000)), TestContext.Current.CancellationToken);
162159
AssertEx.EnsureRunning(t1,t2);
163160

164161
_dispatcher.Publish(evt);
@@ -179,8 +176,8 @@ public void can_wait_for_a_specific_message_twice()
179176
using (var tq = new TestQueue(_dispatcher))
180177
{
181178
var evt = new TestEvent();
182-
var t1 = Task.Run(() => tq.WaitForMsgId(evt.MsgId, TimeSpan.FromMilliseconds(1000)));
183-
var t2 = Task.Run(() => tq.WaitForMsgId(evt.MsgId, TimeSpan.FromMilliseconds(1000)));
179+
var t1 = Task.Run(() => tq.WaitForMsgId(evt.MsgId, TimeSpan.FromMilliseconds(1000)), TestContext.Current.CancellationToken);
180+
var t2 = Task.Run(() => tq.WaitForMsgId(evt.MsgId, TimeSpan.FromMilliseconds(1000)), TestContext.Current.CancellationToken);
184181

185182
tq.Handle(evt);
186183
tq.AssertNext<TestEvent>(evt.CorrelationId)
@@ -214,8 +211,8 @@ public void can_wait_for_multiple_messages_not_yet_received()
214211
var evt = new TestEvent();
215212
var evt2 = new TestEvent();
216213

217-
var t1 = Task.Run(() => tq.WaitForMsgId(evt.MsgId, TimeSpan.FromMilliseconds(200)));
218-
var t2 = Task.Run(() => tq.WaitForMsgId(evt2.MsgId, TimeSpan.FromMilliseconds(200)));
214+
var t1 = Task.Run(() => tq.WaitForMsgId(evt.MsgId, TimeSpan.FromMilliseconds(200)), TestContext.Current.CancellationToken);
215+
var t2 = Task.Run(() => tq.WaitForMsgId(evt2.MsgId, TimeSpan.FromMilliseconds(200)), TestContext.Current.CancellationToken);
219216

220217
_dispatcher.Publish(evt);
221218
_dispatcher.Publish(evt2);

0 commit comments

Comments
 (0)