Hoa central
Public Member Functions | List of all members
Hoa\Math\Test\Unit\Sampler\Combinatorics\Combination\CartesianProduct Class Reference
Inheritance diagram for Hoa\Math\Test\Unit\Sampler\Combinatorics\Combination\CartesianProduct:

Public Member Functions

 case_empty ()
 
 case_X ()
 
 case_X_Y ()
 
 case_X_Y_Z ()
 
- Public Member Functions inherited from Hoa\Test\Unit\Suite
 __construct ()
 
 getTestedClassName ()
 
 getTestedClassNamespace ()
 
 beforeTestMethod ($methodName)
 

Detailed Description

Class .

Test suite of the cartesian product.

Definition at line 50 of file CartesianProduct.php.

Member Function Documentation

Hoa\Math\Test\Unit\Sampler\Combinatorics\Combination\CartesianProduct::case_empty ( )

Definition at line 52 of file CartesianProduct.php.

53  {
54  $this
55  ->given($iterator = new CUT([]))
56  ->when($result = iterator_to_array($iterator))
57  ->then
58  ->array($result)
59  ->isEqualTo([[null]]);
60  }
Hoa\Math\Test\Unit\Sampler\Combinatorics\Combination\CartesianProduct::case_X ( )

Definition at line 62 of file CartesianProduct.php.

63  {
64  $this
65  ->given($iterator = new CUT([1, 2, 3]))
66  ->when($result = iterator_to_array($iterator))
67  ->then
68  ->array($result)
69  ->isEqualTo([
70  [1],
71  [2],
72  [3]
73  ]);
74  }
Hoa\Math\Test\Unit\Sampler\Combinatorics\Combination\CartesianProduct::case_X_Y ( )

Definition at line 76 of file CartesianProduct.php.

77  {
78  $this
79  ->given($iterator = new CUT([1, 2, 3], [4, 5, 6]))
80  ->when($result = iterator_to_array($iterator))
81  ->then
82  ->array($result)
83  ->isEqualTo([
84  [1, 4],
85  [2, 4],
86  [3, 4],
87 
88  [1, 5],
89  [2, 5],
90  [3, 5],
91 
92  [1, 6],
93  [2, 6],
94  [3, 6]
95  ]);
96  }
Hoa\Math\Test\Unit\Sampler\Combinatorics\Combination\CartesianProduct::case_X_Y_Z ( )

Definition at line 98 of file CartesianProduct.php.

99  {
100  $this
101  ->given($iterator = new CUT([1, 2, 3], [4, 5, 6], [7, 8, 9]))
102  ->when($result = iterator_to_array($iterator))
103  ->then
104  ->array($result)
105  ->isEqualTo([
106  [1, 4, 7],
107  [2, 4, 7],
108  [3, 4, 7],
109  [1, 5, 7],
110  [2, 5, 7],
111  [3, 5, 7],
112  [1, 6, 7],
113  [2, 6, 7],
114  [3, 6, 7],
115 
116  [1, 4, 8],
117  [2, 4, 8],
118  [3, 4, 8],
119  [1, 5, 8],
120  [2, 5, 8],
121  [3, 5, 8],
122  [1, 6, 8],
123  [2, 6, 8],
124  [3, 6, 8],
125 
126  [1, 4, 9],
127  [2, 4, 9],
128  [3, 4, 9],
129  [1, 5, 9],
130  [2, 5, 9],
131  [3, 5, 9],
132  [1, 6, 9],
133  [2, 6, 9],
134  [3, 6, 9]
135  ]);
136  }

The documentation for this class was generated from the following file: