File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ describe Vector {
2+ it ' It a collection of points' {
3+ $vector = Vector 1 .. 4
4+ $vector.GetType () | Should - Be ([object []])
5+ $vector |
6+ Should - BeOfType ([int ])
7+ }
8+
9+ it ' Can be a two dimensional vector' {
10+ Vector2 3 , 4 | Should - BeOfType ([Numerics.Vector2 ])
11+ }
12+
13+ it ' Can be a three dimensional vector' {
14+ Vector3 1 , 2 , 3 | Should - BeOfType ([Numerics.Vector3 ])
15+ }
16+
17+ it ' Can be a four dimensional vector' {
18+ Vector4 1 , 2 , 3 , 4 | Should - BeOfType ([Numerics.Vector4 ])
19+ }
20+
21+ context ' Vector Math' {
22+ it ' Can subtract vectors' {
23+ $subtract = (v2 1 2 ) - (v2 1 2 )
24+ $subtract.X | Should - Be 0
25+ $subtract.Y | Should - Be 0
26+ }
27+ it ' Can add vectors' {
28+ $add = (v2 1 2 ) + (v2 1 2 )
29+ $add.X | Should - Be 2
30+ $add.Y | Should - Be 4
31+ }
32+ it ' Can multiply vectors' {
33+ $multiply = (v2 1 2 ) * (v2 1 2 )
34+ $multiply.X | Should - Be 1
35+ $multiply.Y | Should - Be 4
36+ }
37+ it ' Can divide vectors' {
38+ $divide = (v2 1 2 ) / (v2 1 2 )
39+ $divide.X | Should - Be 1
40+ $divide.Y | Should - Be 1
41+ }
42+ }
43+ }
You can’t perform that action at this time.
0 commit comments