diff --git a/src/Redux.DevTools.Universal/Redux.DevTools.Universal.nuget.props b/src/Redux.DevTools.Universal/Redux.DevTools.Universal.nuget.props
index f2f2db6..f9cdb94 100644
--- a/src/Redux.DevTools.Universal/Redux.DevTools.Universal.nuget.props
+++ b/src/Redux.DevTools.Universal/Redux.DevTools.Universal.nuget.props
@@ -3,9 +3,9 @@
True
NuGet
- C:\Dev\redux.net\src\Redux.DevTools.Universal\project.lock.json
+ C:\GH\redux.NET\src\Redux.DevTools.Universal\project.lock.json
$(UserProfile)\.nuget\packages\
- C:\Users\Guillaume\.nuget\packages\
+ C:\Users\Christer\.nuget\packages\
ProjectJson
4.0.0
diff --git a/src/Redux.Tests/AwaitableStoreTests.cs b/src/Redux.Tests/AwaitableStoreTests.cs
new file mode 100644
index 0000000..174e4e8
--- /dev/null
+++ b/src/Redux.Tests/AwaitableStoreTests.cs
@@ -0,0 +1,429 @@
+namespace Redux.Tests
+{
+ using System;
+ using System.Diagnostics;
+ using System.Reactive.Linq;
+ using System.Threading.Tasks;
+
+ using NUnit.Framework;
+
+ [TestFixture]
+ [Timeout(5000)]
+ public class AwaitableStoreTests
+ {
+ private class StoreIncrementAction
+ {
+ }
+
+ private class SagaIncrementAction
+ {
+ }
+
+ private static int Reducer(int state, object action)
+ {
+ switch (action)
+ {
+ case StoreIncrementAction _: return state + 1;
+ default: return state;
+ }
+ }
+
+ private static void BlockingIncrementSaga(SagaIncrementAction action, IStore store)
+ {
+ Task.Delay(100).Wait();
+ store.Dispatch(new StoreIncrementAction());
+ }
+
+ private static async Task AsyncIncrementSaga(SagaIncrementAction action, IStore store)
+ {
+ await Task.Delay(100);
+ store.Dispatch(new StoreIncrementAction());
+ }
+
+ private static void BlockingThrowingSaga(SagaIncrementAction action, IStore store)
+ {
+ throw new Exception();
+ }
+
+ private static Task AsyncThrowingSaga(SagaIncrementAction action, IStore store)
+ {
+ throw new Exception();
+ }
+
+ #region Updating state using delayed saga
+
+ [Test]
+ public async Task AsyncSaga_When_AwaitingDispatchAsync_Should_GetNewState()
+ {
+ // Arrange
+ var store = new AwaitableStore(Reducer, 0);
+ store.Actions.OfType().RunsAsyncSaga(store, AsyncIncrementSaga);
+
+ // Act
+ await store.DispatchAsync(new SagaIncrementAction());
+
+ // Assert
+ Assert.That(store.GetState(), Is.EqualTo(1));
+ }
+
+ [Test]
+ public async Task AsyncSaga_When_NotAwaitingDispatchAsync_Should_GetNewStateAfterSagaCompletes()
+ {
+ // Arrange
+ var store = new AwaitableStore(Reducer, 0);
+ store.Actions.OfType().RunsAsyncSaga(store, AsyncIncrementSaga);
+
+ // Act
+ store.DispatchAsync(new SagaIncrementAction());
+
+ // Assert
+ Assert.That(store.GetState(), Is.EqualTo(0));
+ await Task.Delay(150);
+ Assert.That(store.GetState(), Is.EqualTo(1));
+ }
+
+ [Test]
+ public async Task AsyncSaga_When_UsingNormalDispatch_Should_GetNewStateAfterSagaCompletes()
+ {
+ // Arrange
+ var store = new AwaitableStore(Reducer, 0);
+ store.Actions.OfType().RunsAsyncSaga(store, AsyncIncrementSaga);
+
+ // Act
+ store.Dispatch(new SagaIncrementAction());
+
+ // Assert
+ Assert.That(store.GetState(), Is.EqualTo(0));
+ await Task.Delay(150);
+ Assert.That(store.GetState(), Is.EqualTo(1));
+ }
+
+ [Test]
+ public async Task AsyncSaga_When_StoreIsNonAwaitable_Should_GetNewStateAfterSagaCompletes()
+ {
+ // Arrange
+ var store = new ObservableActionStore(Reducer, 0);
+ store.Actions.OfType().RunsAsyncSaga(store, AsyncIncrementSaga);
+
+ // Act
+ store.Dispatch(new SagaIncrementAction());
+
+ // Assert
+ Assert.That(store.GetState(), Is.EqualTo(0));
+ await Task.Delay(150);
+ Assert.That(store.GetState(), Is.EqualTo(1));
+ }
+
+ [Test]
+ public async Task AsyncSaga_When_AwaitingFirstOfSeveralDispatches_Should_AwaitAllDispatchesAndGetFinalState()
+ {
+ // Arrange
+ var store = new AwaitableStore(Reducer, 0);
+ store.Actions.OfType().RunsAsyncSaga(store, AsyncIncrementSaga);
+
+ // Act
+ Task