Beispiel #1
0
    private void alreadyHasAnotherManagerNotRaise()
    {
        IConversationManager otherConversationManager = new WebConversationManager();

        //Not raise error
        IConversationState otherConversationState = null;
        try
        {
            otherConversationState = new WebConversationSpringState();
            otherConversationState.Id = "otherConversationState";
            otherConversationManager.AddConversation(otherConversationState);
            this.Session["testResult"] = "OK";
        }
        catch (InvalidOperationException ioe)
        {
            this.Session["testResult"] = "NOT OK " + ioe.ToString();
        }
        finally
        {
            otherConversationState.EndConversation();
        }
    }
Beispiel #2
0
    private void alreadyHasAnotherManagerRaise()
    {
        Regex msgErrorRx = new Regex(".*already.*has.*another.*manager.*");
        IConversationManager otherConversationManager = null;

        //Raise error
        try
        {
            otherConversationManager = new WebConversationManager();
            otherConversationManager.AddConversation(this.ConversationA);
            this.Session["testResult"] = "NOT OK";
        }
        catch (InvalidOperationException ioe)
        {
            if (msgErrorRx.IsMatch(ioe.Message))
            {
                this.Session["testResult"] = "OK";
            }
            else
            {
                this.Session["testResult"] = "NOT OK " + ioe.Message;
            }
        }
    }