Beispiel #1
0
        public void Reborn_should_not_call_reborn_on_result_if_task_completed_and_just_return_the_returned_phoenixState()
        {
            IPhoenixState reborn = Substitute.For <IPhoenixState>();
            Func <Task <IPhoenixState> > action = () => Task.FromResult(reborn);
            var           state = new RaisingPhoenix();
            IPhoenixState rebornState;

            do
            {
                rebornState = state.Reborn(action);
            } while (object.ReferenceEquals(rebornState, state));

            reborn.Received(0).Reborn(Arg.Any <Func <Task <IPhoenixState> > >());
        }