本文整理汇总了C#中Grid.AddPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Grid.AddPoint方法的具体用法?C# Grid.AddPoint怎么用?C# Grid.AddPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Grid
的用法示例。
在下文中一共展示了Grid.AddPoint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Remove_coordinate
public void Remove_coordinate()
{
var g = new Grid();
g.AddPoint(1, 1);
Assert.That(g.Has(1, 1));
g.RemovePoint(1, 1);
Assert.That(g.Has(1, 1), Is.False);
}
示例2: Returns_all_points
public void Returns_all_points()
{
var g = new Grid();
g.AddPoint(1, 2);
var p = g.GetAll();
Assert.That(p, Has.Count.EqualTo(1));
Assert.That(p, Has.Member(new Point(1,2)));
}
示例3: Expands_two_point_grid_correctly
public void Expands_two_point_grid_correctly()
{
var g = new Grid();
g.AddPoint(1, 2);
g.AddPoint(1, 3);
var p = g.Expand().GetAll();
Assert.That(p, Has.Count.EqualTo(12));
Assert.That(p, Has.Member(new Point(1, 2)));
Assert.That(p, Has.Member(new Point(0, 1)));
Assert.That(p, Has.Member(new Point(1, 1)));
Assert.That(p, Has.Member(new Point(2, 1)));
Assert.That(p, Has.Member(new Point(0, 2)));
Assert.That(p, Has.Member(new Point(2, 2)));
Assert.That(p, Has.Member(new Point(0, 3)));
Assert.That(p, Has.Member(new Point(1, 3)));
Assert.That(p, Has.Member(new Point(2, 3)));
Assert.That(p, Has.Member(new Point(0, 4)));
Assert.That(p, Has.Member(new Point(1, 4)));
Assert.That(p, Has.Member(new Point(2, 4)));
}
示例4: Return_correct_dimensions
public void Return_correct_dimensions()
{
var g = new Grid();
g.AddPoint(-1, -5);
g.AddPoint(5, 10);
var d = g.GetDimensions();
Assert.That(d.MinX, Is.EqualTo(-1));
Assert.That(d.MinY, Is.EqualTo(-5));
Assert.That(d.MaxX, Is.EqualTo(5));
Assert.That(d.MaxY, Is.EqualTo(10));
}