title: Google Mock: obtain AssertionResult from EXPECT_THAT
body: <p>I'm trying to write a google-test utility function which performs some setup steps base on it's input arguments and finally compares the contents of two containers irrespective of order. I would then like to return a <code>::testing::AssertionResult</code> from this function based on whether the container contents are equal.</p>
  
  <p>For the comparison itself I would like to use functionalities provided by google-mock in order to avoid errors in my own test-code and reduce developement overhead. Something like the following would work:</p>
  
  <pre><code>EXPECT_THAT(actual_container,
      testing::UnorderedElementsAreArray(expected_container))
      &lt;&lt; "Container content equal.";
  </code></pre>
  
  <p>The trouble with this is that I'm not sure if it is even possible to
  obtain an <code>AssertionResult</code> which can be returned from a function in a similar manner.</p>
  
  <p>Does anyone have a solution to this or a suggestion for an alternative approach?</p>