public async Task DeactivateOnIdleWhileActivate() { int id = random.Next(); IDeactivatingWhileActivatingTestGrain grain = this.GrainFactory.GetGrain <IDeactivatingWhileActivatingTestGrain>(id); try { string activation = await grain.DoSomething(); Assert.True(false, "Should have thrown."); } catch (InvalidOperationException exc) { this.Logger.Info("Thrown as expected:", exc); Assert.True( exc.Message.Contains("DeactivateOnIdle from within OnActivateAsync"), "Did not get expected exception message returned: " + exc.Message); } }
public async Task DeactivateOnIdleWhileActivate() { int id = random.Next(); IDeactivatingWhileActivatingTestGrain grain = GrainClient.GrainFactory.GetGrain <IDeactivatingWhileActivatingTestGrain>(id); try { string activation = await grain.DoSomething(); Assert.True(false, "Should have thrown."); } catch (Exception exc) { logger.Info("Thrown as expected:", exc); Exception e = exc.GetBaseException(); Assert.True(e.Message.Contains("Forwarding failed"), "Did not get expected exception message returned: " + e.Message); } }