title: How to compare two collections that vary by properties using Fluent Assertion?
body: <p>I have public class <code>RuleInfo</code> which is created from internal class <code>Rule</code>.</p>
  
  <pre><code>private static RuleInfo CreateRuleInfo(Rule r)
  {
      return new RuleInfo
      {
          RuleCode = r.RuleId,
          DisplayName = r.RuleCode,
          Description = r.Description,
          LegacyRuleCode = null
      };
  }
  </code></pre>
  
  <p>They vary in their properties names so <code>ShouldBeEquivalentTo()</code> or <code>ShouldAllBeEquivalentTo()</code> don't work.</p>
  
  <p>Right now I'm comparing them manually/explicitly:</p>
  
  <pre><code>foreach (var x in Enumerable.Zip(infs, rules, (i, r) =&gt; new { Info = i, Rule = r }))
  {
      x.Info.ShouldBeEquivalentTo(
          new
          {
              RuleCode = x.Rule.RuleId,
              DisplayName = x.Rule.RuleCode,
              Description = x.Rule.Description,
              LegacyRuleCode = (string)null
          });
  }
  </code></pre>
  
  <p>Is there a better, more compact, less explicit, more readable way?</p>