本文整理汇总了C#中Protocol.CompatibleWith方法的典型用法代码示例。如果您正苦于以下问题:C# Protocol.CompatibleWith方法的具体用法?C# Protocol.CompatibleWith怎么用?C# Protocol.CompatibleWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Protocol
的用法示例。
在下文中一共展示了Protocol.CompatibleWith方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompatibleWithProtocol
public void CompatibleWithProtocol()
{
var p1 = new Protocol (2, 6, 5, 4);
var p2 = new Protocol (2, 4);
var p3 = new Protocol (2, 7);
var p4 = new Protocol (2, 3);
Assert.IsTrue (p1.CompatibleWith (p2));
Assert.IsFalse (p1.CompatibleWith (p3));
Assert.IsFalse (p1.CompatibleWith (p4));
}
示例2: CompatibleWithProtcolDifferentId
public void CompatibleWithProtcolDifferentId()
{
var p1 = new Protocol (2, 2);
var p2 = new Protocol (3, 2);
Assert.IsFalse (p1.CompatibleWith (p2));
}
示例3: CompatibleWithVersion
public void CompatibleWithVersion()
{
var p1 = new Protocol (2, 6, 5, 4);
Assert.IsTrue (p1.CompatibleWith (4));
Assert.IsTrue (p1.CompatibleWith (5));
Assert.IsTrue (p1.CompatibleWith (6));
Assert.IsFalse (p1.CompatibleWith (7));
Assert.IsFalse (p1.CompatibleWith (3));
}
示例4: CompatibleWithProtocolSameVersion
public void CompatibleWithProtocolSameVersion()
{
var p1 = new Protocol (2, 2);
var p2 = new Protocol (2, 2);
Assert.IsTrue (p1.CompatibleWith (p2));
}
示例5: CompatibleWithNull
public void CompatibleWithNull()
{
var p1 = new Protocol (2, 1);
Assert.Throws<ArgumentNullException> (() => p1.CompatibleWith (null));
}