public void TestEqual() { KeyPoint p1 = new KeyPoint(1, 3); KeyPoint p2 = new KeyPoint(1, 3); Assert.AreEqual(p1, p2); }
public void TestOperatorNotEqual() { KeyPoint p1 = new KeyPoint(1, 3); KeyPoint p2 = new KeyPoint(4, 9); Assert.IsTrue(p1 != p2); }
public void TestAddFail() { KeyPointCollection list = new KeyPointCollection(); KeyPoint p1 = new KeyPoint(1, 2); KeyPoint p2 = new KeyPoint(1, 2); list.Add(p1); list.Add(p2); Assert.IsTrue(list.Count == 1); }
private void DoInitLayout() { this.Controls.Clear(); this.GridUnlockPointList.Clear(); //获得循环因子 int cycleFactor = (int)Math.Sqrt(Convert.ToDouble(GridUnlockStyle)); for (int x = 1; x <= cycleFactor; x++) { for (int y = 1; y <= cycleFactor; y++) { KeyPoint keyPoint = new KeyPoint(x, y); GridUnlockPoint gridUnlockPoint = new GridUnlockPoint(keyPoint); gridUnlockPoint.BackColor = this.BackColor; gridUnlockPoint.PropertyChanged += gridUnlockPoint_PropertyChanged; //计算坐标 this.Controls.Add(gridUnlockPoint); } } }
//public GridUnlockPoint() { } public GridUnlockPoint(KeyPoint keyPoint) { this.KeyPoint = keyPoint; }