public void Point4DConstructorTest3() { IPoint4D point4D = null; // TODO: 初始化为适当的值 Point4D target = new Point4D(point4D); Assert.Inconclusive("TODO: 实现用来验证目标的代码"); }
public override bool Equals(object o) { if (o == null || !(o is IPoint4D)) { return(false); } IPoint4D p = (IPoint4D)o; return(m_X == p.X && m_Y == p.Y && m_Z == p.Z && m_M == p.M); }
public void GetHashCodeTest() { IPoint4D point4D = null; // TODO: 初始化为适当的值 Point4D target = new Point4D(point4D); // TODO: 初始化为适当的值 int expected = 0; // TODO: 初始化为适当的值 int actual; actual = target.GetHashCode(); Assert.AreEqual(expected, actual); Assert.Inconclusive("验证此测试方法的正确性。"); }
public void op_EqualityTest() { Point4D xCompare = null; // TODO: 初始化为适当的值 IPoint4D yCompare = null; // TODO: 初始化为适当的值 bool expected = false; // TODO: 初始化为适当的值 bool actual; actual = (xCompare == yCompare); Assert.AreEqual(expected, actual); Assert.Inconclusive("验证此测试方法的正确性。"); }
public void ToStringTest() { IPoint4D point4D = null; // TODO: 初始化为适当的值 Point4D target = new Point4D(point4D); // TODO: 初始化为适当的值 string expected = string.Empty; // TODO: 初始化为适当的值 string actual; actual = target.ToString(); Assert.AreEqual(expected, actual); Assert.Inconclusive("验证此测试方法的正确性。"); }
public void XTest() { IPoint4D point4D = null; // TODO: 初始化为适当的值 Point4D target = new Point4D(point4D); // TODO: 初始化为适当的值 float expected = 0F; // TODO: 初始化为适当的值 float actual; target.X = expected; actual = target.X; Assert.AreEqual(expected, actual); Assert.Inconclusive("验证此测试方法的正确性。"); }
public void CompareToTest() { IPoint4D point4D = null; // TODO: 初始化为适当的值 Point4D target = new Point4D(point4D); // TODO: 初始化为适当的值 object other = null; // TODO: 初始化为适当的值 int expected = 0; // TODO: 初始化为适当的值 int actual; actual = target.CompareTo(other); Assert.AreEqual(expected, actual); Assert.Inconclusive("验证此测试方法的正确性。"); }
public void EqualsTest() { IPoint4D point4D = null; // TODO: 初始化为适当的值 Point4D target = new Point4D(point4D); // TODO: 初始化为适当的值 object xObject = null; // TODO: 初始化为适当的值 bool expected = false; // TODO: 初始化为适当的值 bool actual; actual = target.Equals(xObject); Assert.AreEqual(expected, actual); Assert.Inconclusive("验证此测试方法的正确性。"); }
/// <summary> /// /// </summary> /// <param name="xObject"></param> /// <returns></returns> public override bool Equals(object xObject) { if (xObject == null) { return(false); } IPoint4D point4D = xObject as IPoint4D; if (point4D == null) { return(false); } return(m_X == point4D.X && m_Y == point4D.Y && m_Z == point4D.Z && m_O == point4D.O); }
private List <IPoint4D> Iterate(ref List <IPoint4D> grid) { List <IPoint4D> result = new List <IPoint4D>(); int minW = grid.Min(pt => pt.W); int minX = grid.Min(pt => pt.X); int minY = grid.Min(pt => pt.Y); int minZ = grid.Min(pt => pt.Z); int maxW = grid.Max(pt => pt.W); int maxX = grid.Max(pt => pt.X); int maxY = grid.Max(pt => pt.Y); int maxZ = grid.Max(pt => pt.Z); for (int w = minW - 1; w <= maxW + 1; w++) { for (int z = minZ - 1; z <= maxZ + 1; z++) { for (int y = minY - 1; y <= maxY + 1; y++) { for (int x = minX - 1; x <= maxX + 1; x++) { IPoint4D point = Factory.CreatePoint4D(w, x, y, z); int neighbourCount = ActiveNeighbours(ref grid, point); if (grid.Any(pt => ((pt.W == point.W) && (pt.X == point.X) && (pt.Y == point.Y) && (pt.Z == point.Z)))) { if ((neighbourCount == 2) || (neighbourCount == 3)) { result.Add(point); } } else { if (neighbourCount == 3) { result.Add(point); } } } } } } return(result); }
private int ActiveNeighbours(ref List <IPoint4D> grid, IPoint4D point) { int count = 0; for (int w = point.W - 1; w <= point.W + 1; w++) { for (int z = point.Z - 1; z <= point.Z + 1; z++) { for (int y = point.Y - 1; y <= point.Y + 1; y++) { for (int x = point.X - 1; x <= point.X + 1; x++) { if (((w == point.W) && (x == point.X) && (y == point.Y) && (z == point.Z)) == false) { count = count + grid.Where(pt => ((pt.W == w) && (pt.X == x) && (pt.Y == y) && (pt.Z == z))).Count(); } } } } } return(count); }
public Point4D(IPoint4D p) : this(p.X, p.Y, p.Z, p.M) { }
/// <summary> /// /// </summary> /// <param name="point3D"></param> public Point4D(IPoint4D point4D) : this(point4D.X, point4D.Y, point4D.Z, point4D.O) { }