@@ 73-98 (lines=26) @@ | ||
70 | /* |
|
71 | * Test removeAt. |
|
72 | */ |
|
73 | public function testRemoveAt() |
|
74 | { |
|
75 | $this |
|
76 | ->given( |
|
77 | $unique = $this->uniqueValue(), |
|
78 | $collection = $this->emptyCollection() |
|
79 | ) |
|
80 | ->and($comparator = $this->comparator()) |
|
81 | ->then() |
|
82 | ->hashmap($collection) |
|
83 | ->notContainsKey('foo') |
|
84 | ->isSortedUsing($comparator) |
|
85 | ->and() |
|
86 | ->when($collection->set('foo', $unique)) |
|
87 | ->then() |
|
88 | ->hashmap($collection) |
|
89 | ->containsKey('foo') |
|
90 | ->and() |
|
91 | ->when($element = $collection->removeAt('foo')) |
|
92 | ->then() |
|
93 | ->variable($element) |
|
94 | ->isEqualTo($unique) |
|
95 | ->hashmap($collection) |
|
96 | ->isSortedUsing($comparator) |
|
97 | ; |
|
98 | } |
|
99 | ||
100 | /* |
|
101 | * Test sort. |
@@ 77-103 (lines=27) @@ | ||
74 | /* |
|
75 | * Test removeAt. |
|
76 | */ |
|
77 | public function testRemoveAt() |
|
78 | { |
|
79 | $this |
|
80 | ->given( |
|
81 | $unique = $this->uniqueValue(), |
|
82 | $collection = $this->emptyCollection() |
|
83 | ) |
|
84 | ->then() |
|
85 | ->hashmap($collection) |
|
86 | ->notContainsKey('foo') |
|
87 | ->and() |
|
88 | ->when($collection->set('foo', $unique)) |
|
89 | ->then() |
|
90 | ->hashmap($collection) |
|
91 | ->containsKey('foo') |
|
92 | ->and() |
|
93 | ->when($element = $collection->removeAt('bar')) |
|
94 | ->then() |
|
95 | ->variable($element) |
|
96 | ->isNull() |
|
97 | ->and() |
|
98 | ->when($element = $collection->removeAt('foo')) |
|
99 | ->then() |
|
100 | ->variable($element) |
|
101 | ->isEqualTo($unique) |
|
102 | ; |
|
103 | } |
|
104 | ||
105 | /** |
|
106 | * Test find. |