本文整理汇总了C#中Custom.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Custom.Equals方法的具体用法?C# Custom.Equals怎么用?C# Custom.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Custom
的用法示例。
在下文中一共展示了Custom.Equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldEqualIdenticalGrid
public void ShouldEqualIdenticalGrid()
{
var a = new Custom(Color.Red, 42);
var b = new Custom(Color.Red, 42);
Assert.True(a == b);
Assert.False(a != b);
Assert.True(a.Equals(b));
Assert.AreEqual(a, b);
}
示例2: ShouldNotEqualDifferentGrid
public void ShouldNotEqualDifferentGrid()
{
var a = new Custom(Color.Red, 42);
var b = new Custom(Color.Pink, 666);
Assert.False(a == b);
Assert.True(a != b);
Assert.False(a.Equals(b));
Assert.AreNotEqual(a, b);
}
示例3: ShouldNotEqualDifferentArray
public void ShouldNotEqualDifferentArray()
{
var effect = new Custom(Color.Red);
var array = new Color[Constants.MaxLeds];
for (var i = 0; i < Constants.MaxLeds; i++)
array[i] = Color.Blue;
Assert.False(effect == array);
Assert.True(effect != array);
Assert.False(effect.Equals(array));
Assert.AreNotEqual(effect, array);
}
示例4: ShouldNotEqualDifferentEffect
public void ShouldNotEqualDifferentEffect()
{
var a = new Custom(Color.Red);
var b = new Custom(Color.Blue);
Assert.False(a == b);
Assert.True(a != b);
Assert.False(a.Equals(b));
Assert.AreNotEqual(a, b);
}
示例5: ShouldNotEqualArrayWithInvalidLength
public void ShouldNotEqualArrayWithInvalidLength()
{
var effect = new Custom(Color.Red);
var array = new[] { Color.Red, Color.Red, Color.Red };
Assert.False(effect == array);
Assert.True(effect != array);
Assert.False(effect.Equals(array));
Assert.AreNotEqual(effect, array);
}