本文整理汇总了C#中IContact.ShouldBeEquivalentTo方法的典型用法代码示例。如果您正苦于以下问题:C# IContact.ShouldBeEquivalentTo方法的具体用法?C# IContact.ShouldBeEquivalentTo怎么用?C# IContact.ShouldBeEquivalentTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IContact
的用法示例。
在下文中一共展示了IContact.ShouldBeEquivalentTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssertContactsEqual
private static void AssertContactsEqual(
IContact actual,
IContact expected,
Func<LeaseData, bool> leaseAssertion = null)
{
actual.ShouldBeEquivalentTo(expected, op => op
.Excluding(c => c.Lease)
.Excluding(c => c.Identifiers)
.Excluding(c => c.Tags)
.Excluding(c => c.System)
.Excluding(c => c.Extensions)
.Excluding(c => c.Facets));
actual.Identifiers.ShouldBeEquivalentTo(expected.Identifiers, op => op.Excluding(i => i.Members));
actual.Tags.ShouldBeEquivalentTo(expected.Tags, op => op.Excluding(i => i.Members));
actual.System.ShouldBeEquivalentTo(expected.System, op => op.Excluding(i => i.Members));
actual.Extensions.ShouldBeEquivalentTo(expected.Extensions, op => op.Excluding(i => i.Members));
actual.Facets.ShouldBeEquivalentTo(expected.Facets);
if (leaseAssertion != null)
{
leaseAssertion(actual.Lease).Should().BeTrue();
}
else
{
actual.Lease.ShouldBeEquivalentTo(expected.Lease, opt => opt.Excluding(l => l.ExpirationTime));
}
}
开发者ID:freemsly,项目名称:Sitecore-ElasticAnalytics,代码行数:28,代码来源:ElasticAnalyticsDataAdapterProvider.ContactFixture.cs