0

I created a composite context action that returns a couple of intentions with the following texts:

  • [Tag] Action
  • Second Action

Now I'm trying to cover this action by tests. I did everything by guidelines, but I'm not able to identify the first action using the caret notation.

I've tried the following options:

  • {caret:[Tag]:Action}
  • {caret:Tag:Action}

Note of them worked :(

If I do the same for the Second Action, everything is fine. Likely, issue is related to brackets.

I don't want to change name of the action. Could you advice how to specify the action with brackets?

Thanks!

UPDATE

I've found the following workaround:

  1. In data file specify alias for action: {caret:TagAction}.
  2. Override SelectItem method and adjust attribute

    protected override IBulbAction SelectItem(SetFrozenAttributeAction contextAction, string attribute, ITextControl textControl)
    {
      if (attribute == "TagAction") attribute = "[Tag] Action";
      return base.SelectItem(contextAction, attribute, textControl);
    }
    

If you know better way - suggest it :)

1 Answer 1

1

Yes, it's the brackets. I don't know why, but when it encounters the opening brace {, it doesn't read up to a closing brace }, but reads a set of chars that it deems are "valid", and then stops when it hits the first non-valid char. The valid chars are char.IsLetter, char.IsDigit and $, (, ), , -, ., /, \. But not [ or ] - so your {caret:[Tag] Action} would just read {caret: and then stop.

Your workaround seems like the best bet!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.