本文整理汇总了C#中Point2.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Point2.Equals方法的具体用法?C# Point2.Equals怎么用?C# Point2.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point2
的用法示例。
在下文中一共展示了Point2.Equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Point2_EqualsObject
public void Point2_EqualsObject()
{
var size1 = new Point2(123, 456);
var size2 = new Point2(123, 456);
TheResultingValue(size1.Equals((Object)size2)).ShouldBe(true);
TheResultingValue(size1.Equals("This is a test")).ShouldBe(false);
}
示例2: Point2_EqualsPoint
public void Point2_EqualsPoint()
{
var size1 = new Point2(123, 456);
var size2 = new Point2(123, 456);
var size3 = new Point2(123, 555);
var size4 = new Point2(222, 456);
TheResultingValue(size1.Equals(size2)).ShouldBe(true);
TheResultingValue(size1.Equals(size3)).ShouldBe(false);
TheResultingValue(size1.Equals(size4)).ShouldBe(false);
}
示例3: equal_coordinate_pair
public void equal_coordinate_pair() {
var a = new Point2(1, 2);
var b = new Point2(3, 4);
var c = new Point2(3, 4);
ICoordinatePair<double> nil = null;
Assert.False(a.Equals((ICoordinatePair<double>)b));
Assert.False(a.Equals((ICoordinatePair<double>)c));
Assert.False(b.Equals((ICoordinatePair<double>)a));
Assert.True(b.Equals((ICoordinatePair<double>)c));
Assert.False(c.Equals((ICoordinatePair<double>)a));
Assert.True(c.Equals((ICoordinatePair<double>)b));
Assert.False(a.Equals(nil));
}
示例4: equal_object
public void equal_object() {
var a = new Point2(1, 2);
var b = new Point2(3, 4);
var c = new Point2(3, 4);
Assert.False(a.Equals((object)(new Vector2(b))));
Assert.False(a.Equals((object)(new Vector2(c))));
Assert.False(((object)b).Equals(a));
Assert.True(((object)b).Equals(new Vector2(c)));
Assert.False(c.Equals((object)a));
Assert.True(c.Equals((object)b));
}
示例5: equal_type
public void equal_type() {
var a = new Point2(1, 2);
var b = new Point2(3, 4);
var c = new Point2(3, 4);
Assert.False(a.Equals(b));
Assert.False(a.Equals(c));
Assert.False(b.Equals(a));
Assert.True(b.Equals(c));
Assert.False(c.Equals(a));
Assert.True(c.Equals(b));
}