private void FailUnexpectedInvocation(Invocation invocation)
        {
            var description = new StringDescriptionWriter();
            description.AppendText("unexpected invocation of ");
            invocation.DescribeOn(description);

            description.AppendNewLine();
            DescribeActiveExpectationsTo(description);

            description.AppendList("\nstates:\n" , Environment.NewLine, string.Empty, stateMachines);

            // try catch to get exception with stack trace.
            throw new ExpectationException(description.ToString());
        }