Ejemplo n.º 1
0
        public void Not_equals_operator_false_for_identical_EdgeLength()
        {
            var e1 = new EdgeLength(10d, 20d, 30d);
            var e2 = new EdgeLength(10d, 20d, 30d);

            Assert.IsFalse(e1 != e2);
        }
Ejemplo n.º 2
0
        public void Equals_operator_true_for_identical_EdgeLength()
        {
            var e1 = new EdgeLength(10d, 20d, 30d);
            var e2 = new EdgeLength(10d, 20d, 30d);

            Assert.IsTrue(e1 == e2);
        }
Ejemplo n.º 3
0
        public void Equals_operator_false_for_different_EdgeLength()
        {
            var e1 = new EdgeLength(10d, 20d, 30d);
            var e2 = new EdgeLength(40d, 50d, 60d);

            Assert.IsFalse(e1 == e2);
        }
Ejemplo n.º 4
0
        public void Not_equals_operator_true_for_different_EdgeLength()
        {
            var e1 = new EdgeLength(10d, 20d, 30d);
            var e2 = new EdgeLength(40d, 50d, 60d);

            Assert.IsTrue(e1 != e2);
        }
Ejemplo n.º 5
0
        public void Division_operator_returns_correct_result()
        {
            var e1 = new EdgeLength(10d, 20d, 30d);
            var e2 = e1 / 10d;

            Assert.AreApproximatelyEqual((float)e2.X, 1f);
            Assert.AreApproximatelyEqual((float)e2.Y, 2f);
            Assert.AreApproximatelyEqual((float)e2.Z, 3f);
        }
Ejemplo n.º 6
0
        public void Multiplication_operator_returns_correct_result()
        {
            var e1 = new EdgeLength(10d, 20d, 30d);
            var e2 = e1 * 10d;

            Assert.AreApproximatelyEqual((float)e2.X, 100f);
            Assert.AreApproximatelyEqual((float)e2.Y, 200f);
            Assert.AreApproximatelyEqual((float)e2.Z, 300f);
        }
Ejemplo n.º 7
0
        public void EdgeLength_from_Vector3_has_equal_component_values()
        {
            var vector     = new Vector3(10f, 20f, 30f);
            var edgeLength = EdgeLength.FromUnityVector(vector);

            Assert.AreApproximatelyEqual((float)edgeLength.X, vector.x);
            Assert.AreApproximatelyEqual((float)edgeLength.Y, vector.y);
            Assert.AreApproximatelyEqual((float)edgeLength.Z, vector.z);
        }
Ejemplo n.º 8
0
        public void EdgeLength_to_Vector3_has_equal_component_values()
        {
            var edgeLength = new EdgeLength(10f, 20f, 30f);
            var vector     = edgeLength.ToUnityVector();

            Assert.AreApproximatelyEqual((float)edgeLength.X, vector.x);
            Assert.AreApproximatelyEqual((float)edgeLength.Y, vector.y);
            Assert.AreApproximatelyEqual((float)edgeLength.Z, vector.z);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// ハッシュ値を計算します。
 /// </summary>
 public override int GetHashCode()
 {
     return(
         Font.GetHashCode() ^
         Color.GetHashCode() ^
         EdgeColor.GetHashCode() ^
         EdgeLength.GetHashCode() ^
         IsStretchSize.GetHashCode());
 }
Ejemplo n.º 10
0
        public void Subtraction_operator_returns_correct_result()
        {
            var e1 = new EdgeLength(10d, 20d, 30d);
            var e2 = new EdgeLength(40d, 50d, 60d);

            var e3 = e2 - e1;

            Assert.AreApproximatelyEqual((float)e3.X, 30f);
            Assert.AreApproximatelyEqual((float)e3.Y, 30f);
            Assert.AreApproximatelyEqual((float)e3.Z, 30f);
        }
Ejemplo n.º 11
0
        public void Addition_operator_returns_correct_result()
        {
            var e1 = new EdgeLength(10d, 20d, 30d);
            var e2 = new EdgeLength(40d, 50d, 60d);

            var e3 = e1 + e2;

            Assert.AreApproximatelyEqual((float)e3.X, 50f);
            Assert.AreApproximatelyEqual((float)e3.Y, 70f);
            Assert.AreApproximatelyEqual((float)e3.Z, 90f);
        }
Ejemplo n.º 12
0
 /// <summary>
 /// ハッシュ値を計算します。
 /// </summary>
 public override int GetHashCode()
 {
     return(
         FontFamilyName.GetHashCode() ^
         FontStyle.GetHashCode() ^
         Size.GetHashCode() ^
         Color.GetHashCode() ^
         EdgeColor.GetHashCode() ^
         EdgeLength.GetHashCode() ^
         IsStretchSize.GetHashCode());
 }
Ejemplo n.º 13
0
 public static unsafe void Write(global::Improbable.Worker.Internal.GcHandlePool _pool,
                                 EdgeLength _data, global::Improbable.Worker.CInterop.SchemaObject _obj)
 {
     {
         _obj.AddDouble(1, _data.x);
     }
     {
         _obj.AddDouble(2, _data.y);
     }
     {
         _obj.AddDouble(3, _data.z);
     }
 }
Ejemplo n.º 14
0
 public static unsafe void Write(global::Improbable.Worker.Internal.GcHandlePool _pool,
                                 EdgeLength _data, global::Improbable.Worker.Internal.Pbio.Object *_obj)
 {
     {
         global::Improbable.Worker.Internal.Pbio.AddDouble(_obj, 1, _data.x);
     }
     {
         global::Improbable.Worker.Internal.Pbio.AddDouble(_obj, 2, _data.y);
     }
     {
         global::Improbable.Worker.Internal.Pbio.AddDouble(_obj, 3, _data.z);
     }
 }
 /// <summary>
 ///     Extension method for converting a Unity Vector to an EdgeLength.
 /// </summary>
 public static EdgeLength ToEdgeLength(this Vector3 unityVector)
 {
     return(EdgeLength.FromUnityVector(unityVector));
 }