Added additional check against nonmatrix objects.
authorJarl Gullberg <jarl.gullberg@gmail.com>
Wed, 31 May 2017 18:21:16 +0000 (20:21 +0200)
committerJarl Gullberg <jarl.gullberg@gmail.com>
Wed, 31 May 2017 18:21:16 +0000 (20:21 +0200)
tests/OpenTK.Tests/Matrix4Tests.fs
tests/OpenTK.Tests/Vector3Tests.fs

index 8153abf..a37cd92 100644 (file)
@@ -92,13 +92,17 @@ module Matrix4 =
     module Equality = 
         //
         [<Property>]
-        let ``Sixteen value constructor sets all components to the correct values`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) =
+        let ``Two matrices with identical values are equal`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) =
             let A = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
             let B = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
             let equality = A = B
             
             Assert.True(equality)
             
+        [<Property>]
+        let ``A matrix is not equal to an object which is not a matrix`` (a : Matrix4, b : Vector3) =
+            Assert.False(a.Equals(b))
+
     [<Properties(Arbitrary = [| typeof<OpenTKGen> |])>]
     module Multiplication = 
         //
index 77bde23..9d64354 100644 (file)
@@ -113,13 +113,13 @@ module Vector3 =
         let ``Normalization of instance, creating a new vector, works`` (a, b, c) = 
             let v = Vector3(a, b, c)
             let l = v.Length
-
+            
             let norm = v.Normalized()
 
             Assert.ApproximatelyEqual(v.X / l, norm.X)
             Assert.ApproximatelyEqual(v.Y / l, norm.Y)
             Assert.ApproximatelyEqual(v.Z / l, norm.Z)
-            
+
         [<Property>]
         let ``Normalization of instance works`` (a, b, c) = 
             let v = Vector3(a, b, c)