本文整理汇总了C#中Microsoft.OData.Edm.Library.EdmComplexTypeReference.IsEquivalentTo方法的典型用法代码示例。如果您正苦于以下问题:C# EdmComplexTypeReference.IsEquivalentTo方法的具体用法?C# EdmComplexTypeReference.IsEquivalentTo怎么用?C# EdmComplexTypeReference.IsEquivalentTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.OData.Edm.Library.EdmComplexTypeReference
的用法示例。
在下文中一共展示了EdmComplexTypeReference.IsEquivalentTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EqualityComplexTypeReferenceTypeTest
public void EqualityComplexTypeReferenceTypeTest()
{
var simpleBaselineComplexType = new EdmComplexType("NS", "Baseline");
var simpleDifferentNameComplexType= new EdmComplexType("NS", "Different");
var simpleDifferentNamespaceComplexType = new EdmComplexType("Foo", "Base");
var simpleBaseline = new EdmComplexTypeReference(simpleBaselineComplexType, true);
var simpleMatch = new EdmComplexTypeReference(simpleBaselineComplexType, true);
var simpleDifferentNullibility = new EdmComplexTypeReference(simpleBaselineComplexType, false);
var simpleDifferentNameType = new EdmComplexTypeReference(simpleDifferentNameComplexType, true);
var simpleDifferentNamespaceType = new EdmComplexTypeReference(simpleDifferentNamespaceComplexType, true);
Assert.IsTrue(simpleBaseline.IsEquivalentTo(simpleMatch), "Is the same.");
Assert.IsFalse(simpleBaseline.IsEquivalentTo(simpleDifferentNullibility), "Different Nullibility.");
Assert.IsFalse(simpleBaseline.IsEquivalentTo(simpleDifferentNameType), "Different name simple complex type.");
Assert.IsFalse(simpleBaseline.IsEquivalentTo(simpleDifferentNamespaceType), "Different namespace for simple complex type.");
var baselineBaseComplexType = new EdmComplexType("NS", "Base");
var fooBaseComplexType = new EdmComplexType("NS", "Foo");
var baselineComplexType = new EdmComplexType("NS", "Baseline", baselineBaseComplexType, false);
var differentBaseComplexType = new EdmComplexType("NS", "Baseline", fooBaseComplexType, false);
var nullBaseTypeComplexType = new EdmComplexType("NS", "Baseline", null, false);
var differentAbstractComplexType = new EdmComplexType("NS", "Baseline", baselineBaseComplexType, true);
var baseline = new EdmComplexTypeReference(baselineComplexType, true);
var match = new EdmComplexTypeReference(baselineComplexType, true);
var differentBaseType = new EdmComplexTypeReference(differentBaseComplexType, true);
var nullBaseType = new EdmComplexTypeReference(nullBaseTypeComplexType, true);
var differentAbstractType = new EdmComplexTypeReference(differentAbstractComplexType, true);
this.VerifyThrowsException(typeof(ArgumentNullException), () => new EdmComplexTypeReference(null, true));
Assert.IsTrue(baseline.IsEquivalentTo(match), "Is the same.");
Assert.IsFalse(baseline.IsEquivalentTo(differentBaseType), "Different base type.");
Assert.IsFalse(baseline.IsEquivalentTo(nullBaseType), "Null base type.");
Assert.IsFalse(baseline.IsEquivalentTo(differentAbstractType), "Different abstract type.");
}