public void TestEquals() { Vector4H a = new Vector4H(1.0f, 2.0f, 3.0f, 4.0f); Vector4H b = new Vector4H(4.0f, 5.0f, 6.0f, 7.0f); Vector4H c = new Vector4H(1.0f, 2.0f, 3.0f, 4.0f); Assert.IsTrue(a.Equals(c)); Assert.IsTrue(c.Equals(a)); Assert.IsTrue(a == c); Assert.IsTrue(c == a); Assert.IsFalse(c != a); Assert.IsFalse(c != a); Assert.IsFalse(a.Equals(b)); Assert.IsFalse(b.Equals(a)); Assert.IsFalse(a == b); Assert.IsFalse(b == a); Assert.IsTrue(a != b); Assert.IsTrue(b != a); object objA = a; object objB = b; object objC = c; Assert.IsTrue(a.Equals(objA)); Assert.IsTrue(a.Equals(objC)); Assert.IsFalse(a.Equals(objB)); Assert.IsTrue(objA.Equals(objC)); Assert.IsFalse(objA.Equals(objB)); Assert.IsFalse(a.Equals(null)); Assert.IsFalse(a.Equals(5)); }
public void XY() { Vector4H a = new Vector4H(1.0, 2.0, 3.0, 4.0); Vector2H xy = a.XY; Assert.AreEqual((Half)1.0, xy.X); Assert.AreEqual((Half)2.0, xy.Y); }
public void Construct2() { Vector4H v = new Vector4H(new Vector2H(1.0, 2.0), (Half)3.0, (Half)4.0); Assert.AreEqual((Half)1.0, v.X); Assert.AreEqual((Half)2.0, v.Y); Assert.AreEqual((Half)3.0, v.Z); Assert.AreEqual((Half)4.0, v.W); }
public void XYZ() { Vector4H a = new Vector4H(1.0, 2.0, 3.0, 4.0); Vector3H xyz = a.XYZ; Assert.AreEqual((Half)1.0, xyz.X); Assert.AreEqual((Half)2.0, xyz.Y); Assert.AreEqual((Half)3.0, xyz.Z); }
public void TestGetHashCode() { Vector4H a = new Vector4H(1.0f, 2.0f, 3.0f, 4.0f); Vector4H b = new Vector4H(4.0f, 5.0f, 6.0f, 7.0f); Vector4H c = new Vector4H(1.0f, 2.0f, 3.0f, 4.0f); Assert.AreEqual(a.GetHashCode(), c.GetHashCode()); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void ToVector4B() { Vector4H a = new Vector4H(0.0, 1.0, 1.0, 0.0); Vector4B sA = a.ToVector4B(); Assert.IsFalse(sA.X); Assert.IsTrue(sA.Y); Assert.IsTrue(sA.Z); Assert.IsFalse(sA.W); }
public void ToVector4I() { Vector4H a = new Vector4H(1.0, 2.0, 3.0, 4.0); Vector4I sA = a.ToVector4I(); Assert.AreEqual(1, sA.X); Assert.AreEqual(2, sA.Y); Assert.AreEqual(3, sA.Z); Assert.AreEqual(4, sA.W); }
public void ToVector4D() { Vector4H a = new Vector4H(1.0, 2.0, 3.0, 4.0); Vector4D sA = a.ToVector4D(); Assert.AreEqual(1.0, sA.X, 1e-7); Assert.AreEqual(2.0, sA.Y, 1e-7); Assert.AreEqual(3.0, sA.Z, 1e-7); Assert.AreEqual(4.0, sA.W, 1e-7); }
public void ToVector4H() { Vector4D a = new Vector4D(1.0, 2.0, 3.0, 4.0); Vector4H sA = a.ToVector4H(); Assert.AreEqual((Half)1.0, sA.X, 1e-7); Assert.AreEqual((Half)2.0, sA.Y, 1e-7); Assert.AreEqual((Half)3.0, sA.Z, 1e-7); Assert.AreEqual((Half)4.0, sA.W, 1e-7); }
public void ToVector4H() { Vector4F a = new Vector4F(1.0f, 2.0f, 3.0f, 4.0f); Vector4H sA = a.ToVector4H(); Assert.AreEqual((Half)1.0f, sA.X, 1e-7); Assert.AreEqual((Half)2.0f, sA.Y, 1e-7); Assert.AreEqual((Half)3.0f, sA.Z, 1e-7); Assert.AreEqual((Half)4.0f, sA.W, 1e-7); }
public void ToVector4H() { Vector4B a = new Vector4B(false, false, true, true); Vector4H sA = a.ToVector4H(); Assert.AreEqual((Half)0, sA.X); Assert.AreEqual((Half)0, sA.Y); Assert.AreEqual((Half)1, sA.Z); Assert.AreEqual((Half)1, sA.W); }
public void ToVector4H() { Vector4I a = new Vector4I(1, 2, 3, 4); Vector4H sA = a.ToVector4H(); Assert.AreEqual((Half)1, sA.X, 1e-7); Assert.AreEqual((Half)2, sA.Y, 1e-7); Assert.AreEqual((Half)3, sA.Z, 1e-7); Assert.AreEqual((Half)4, sA.W, 1e-7); }
public void TestToString() { CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture; try { Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR"); Vector4H a = new Vector4H(1.23f, 2.34f, 3.45f, 4.56f); Assert.AreEqual("(1,230469, 2,339844, 3,449219, 4,558594)", a.ToString()); } finally { Thread.CurrentThread.CurrentCulture = originalCulture; } }
public void Construct0() { Vector4H v1 = new Vector4H(1.0f, 2.0f, 3.0f, 4.0f); Assert.AreEqual((Half)1.0f, v1.X); Assert.AreEqual((Half)2.0f, v1.Y); Assert.AreEqual((Half)3.0f, v1.Z); Assert.AreEqual((Half)4.0f, v1.W); Vector4H v2 = new Vector4H(1.0, 2.0, 3.0, 4.0); Assert.AreEqual((Half)1.0, v2.X); Assert.AreEqual((Half)2.0, v2.Y); Assert.AreEqual((Half)3.0, v2.Z); Assert.AreEqual((Half)4.0, v2.W); }