public void EchoGrain_EchoError() { grain = GrainClient.GrainFactory.GetGrain<IEchoTaskGrain>(Guid.NewGuid()); Task<string> promise = grain.EchoErrorAsync(expectedEchoError); bool ok = promise.ContinueWith(t => { if (!t.IsFaulted) Assert.Fail("EchoError should not have completed successfully"); Exception exc = t.Exception; while (exc is AggregateException) exc = exc.InnerException; string received = exc.Message; Assert.AreEqual(expectedEchoError, received); }).Wait(timeout); Assert.IsTrue(ok, "Finished OK"); }
public async Task EchoGrain_EchoError() { grain = this.GrainFactory.GetGrain <IEchoTaskGrain>(Guid.NewGuid()); Task <string> promise = grain.EchoErrorAsync(expectedEchoError); await promise.ContinueWith(t => { if (!t.IsFaulted) { Assert.True(false); // EchoError should not have completed successfully } Exception exc = t.Exception; while (exc is AggregateException) { exc = exc.InnerException; } string received = exc.Message; Assert.Equal(expectedEchoError, received); }).WithTimeout(timeout); }
public void EchoGrain_EchoError() { grain = GrainClient.GrainFactory.GetGrain <IEchoTaskGrain>(Guid.NewGuid()); Task <string> promise = grain.EchoErrorAsync(expectedEchoError); bool ok = promise.ContinueWith(t => { if (!t.IsFaulted) { Assert.Fail("EchoError should not have completed successfully"); } Exception exc = t.Exception; while (exc is AggregateException) { exc = exc.InnerException; } string received = exc.Message; Assert.AreEqual(expectedEchoError, received); }).Wait(timeout); Assert.IsTrue(ok, "Finished OK"); }