title: Can I use Moq to verify that a mocked method was called with specific values in a complex parameter?
body: <p>So assume I am mocking the following class:</p>
  
  <pre><code>public class ClassAParams
  {
      public int RequestedId { get; set; }
      public string SomeValue { get; set; }
  }
  
  public class ClassA
  {
      public void ExecuteAction(ClassAParams executeParams) {}
  }
  </code></pre>
  
  <p>Now say I have another class (let's call it <code>ClassB</code>) that I am creating a unit testing for, and I want to make sure that when <code>ClassB.Execute()</code> is called, that <code>ClassB</code> calls <code>ClassA.ExecuteAction()</code> but I want to make sure that the parameter it calls that method with has a <code>ClassAParams.RequestedId</code> value of 1.</p>
  
  <p>Normally, I would handle this by doing <code>myMock.Verify(x =&gt; x.ExecuteAction(new ClassAParams { RequestedId = 1, SomeValue = "something" }));</code></p>
  
  <p>The problem is, I do not want to check the value of the <code>SomeValue</code> parameter, or any other <code>ClassAParams</code> properties in this unit test.  The other properties will be checked in other unit tests, but having to verify that it's called with the correct properties in every unit test (even when I don't care in the scope of a specific unit tests) will make unit maintenance annoying.</p>
  
  <p>Is there any way to use Moq to verify that the structure that gets passed into a mocked method only has certain properties as a specific value, and ignore the rest?</p>