コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }