|
1 | 1 | // Copyright © 2020 ONIXLabs |
2 | | -// |
| 2 | +// |
3 | 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | // you may not use this file except in compliance with the License. |
5 | 5 | // You may obtain a copy of the License at |
6 | | -// |
| 6 | +// |
7 | 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
8 | | -// |
| 8 | +// |
9 | 9 | // Unless required by applicable law or agreed to in writing, software |
10 | 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
11 | 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
@@ -45,187 +45,170 @@ public sealed class CollectionTests |
45 | 45 | public void CollectionsEmptyEnumerableShouldProduceTheExpectedResult() |
46 | 46 | { |
47 | 47 | // Given |
48 | | - IEnumerable<object> expected = Enumerable.Empty<object>(); |
49 | | - IEnumerable<object> actual = EmptyEnumerable<object>(); |
| 48 | + IEnumerable<object> candidate = EmptyEnumerable<object>(); |
50 | 49 |
|
51 | 50 | // Then |
52 | | - Assert.Equal(expected, actual); |
| 51 | + Assert.Empty(candidate); |
53 | 52 | } |
54 | 53 |
|
55 | 54 | [Fact(DisplayName = "Collections.EmptyArray should produce the expected result")] |
56 | 55 | public void CollectionsEmptyArrayShouldProduceTheExpectedResult() |
57 | 56 | { |
58 | 57 | // Given |
59 | | - object[] expected = Array.Empty<object>(); |
60 | | - object[] actual = EmptyArray<object>(); |
| 58 | + object[] candidate = EmptyArray<object>(); |
61 | 59 |
|
62 | 60 | // Then |
63 | | - Assert.Equal(expected, actual); |
| 61 | + Assert.Empty(candidate); |
64 | 62 | } |
65 | 63 |
|
66 | 64 | [Fact(DisplayName = "Collections.EmptyImmutableArray should produce the expected result")] |
67 | 65 | public void CollectionsEmptyImmutableArrayShouldProduceTheExpectedResult() |
68 | 66 | { |
69 | 67 | // Given |
70 | | - ImmutableArray<object> expected = ImmutableArray.Create<object>(); |
71 | | - ImmutableArray<object> actual = EmptyImmutableArray<object>(); |
| 68 | + ImmutableArray<object> candidate = EmptyImmutableArray<object>(); |
72 | 69 |
|
73 | 70 | // Then |
74 | | - Assert.Equal(expected, actual); |
| 71 | + Assert.Empty(candidate); |
75 | 72 | } |
76 | 73 |
|
77 | 74 | [Fact(DisplayName = "Collections.EmptyList should produce the expected result")] |
78 | 75 | public void CollectionsEmptyListShouldProduceTheExpectedResult() |
79 | 76 | { |
80 | 77 | // Given |
81 | | - List<object> expected = new(); |
82 | | - List<object> actual = EmptyList<object>(); |
| 78 | + List<object> candidate = EmptyList<object>(); |
83 | 79 |
|
84 | 80 | // Then |
85 | | - Assert.Equal(expected, actual); |
| 81 | + Assert.Empty(candidate); |
86 | 82 | } |
87 | 83 |
|
88 | 84 | [Fact(DisplayName = "Collections.EmptyImmutableList should produce the expected result")] |
89 | 85 | public void CollectionsEmptyImmutableListShouldProduceTheExpectedResult() |
90 | 86 | { |
91 | 87 | // Given |
92 | | - ImmutableList<object> expected = ImmutableList.Create<object>(); |
93 | | - ImmutableList<object> actual = EmptyImmutableList<object>(); |
| 88 | + ImmutableList<object> candidate = EmptyImmutableList<object>(); |
94 | 89 |
|
95 | 90 | // Then |
96 | | - Assert.Equal(expected, actual); |
| 91 | + Assert.Empty(candidate); |
97 | 92 | } |
98 | 93 |
|
99 | 94 | [Fact(DisplayName = "Collections.EmptyDictionary should produce the expected result")] |
100 | 95 | public void CollectionsEmptyDictionaryShouldProduceTheExpectedResult() |
101 | 96 | { |
102 | 97 | // Given |
103 | | - Dictionary<object, object> expected = new(); |
104 | | - Dictionary<object, object> actual = EmptyDictionary<object, object>(); |
| 98 | + Dictionary<object, object> candidate = EmptyDictionary<object, object>(); |
105 | 99 |
|
106 | 100 | // Then |
107 | | - Assert.Equal(expected, actual); |
| 101 | + Assert.Empty(candidate); |
108 | 102 | } |
109 | 103 |
|
110 | 104 | [Fact(DisplayName = "Collections.EmptyImmutableDictionary should produce the expected result")] |
111 | 105 | public void CollectionsEmptyImmutableDictionaryShouldProduceTheExpectedResult() |
112 | 106 | { |
113 | 107 | // Given |
114 | | - ImmutableDictionary<object, object> expected = ImmutableDictionary.Create<object, object>(); |
115 | | - ImmutableDictionary<object, object> actual = EmptyImmutableDictionary<object, object>(); |
| 108 | + ImmutableDictionary<object, object> candidate = EmptyImmutableDictionary<object, object>(); |
116 | 109 |
|
117 | 110 | // Then |
118 | | - Assert.Equal(expected, actual); |
| 111 | + Assert.Empty(candidate); |
119 | 112 | } |
120 | 113 |
|
121 | 114 | [Fact(DisplayName = "Collections.EmptySortedDictionary should produce the expected result")] |
122 | 115 | public void CollectionsEmptySortedDictionaryShouldProduceTheExpectedResult() |
123 | 116 | { |
124 | 117 | // Given |
125 | | - SortedDictionary<object, object> expected = new(); |
126 | | - SortedDictionary<object, object> actual = EmptySortedDictionary<object, object>(); |
| 118 | + SortedDictionary<object, object> candidate = EmptySortedDictionary<object, object>(); |
127 | 119 |
|
128 | 120 | // Then |
129 | | - Assert.Equal(expected, actual); |
| 121 | + Assert.Empty(candidate); |
130 | 122 | } |
131 | 123 |
|
132 | 124 | [Fact(DisplayName = "Collections.EmptyImmutableSortedDictionary should produce the expected result")] |
133 | 125 | public void CollectionsEmptyImmutableSortedDictionaryShouldProduceTheExpectedResult() |
134 | 126 | { |
135 | 127 | // Given |
136 | | - ImmutableSortedDictionary<object, object> expected = ImmutableSortedDictionary.Create<object, object>(); |
137 | | - ImmutableSortedDictionary<object, object> actual = EmptyImmutableSortedDictionary<object, object>(); |
| 128 | + ImmutableSortedDictionary<object, object> candidate = EmptyImmutableSortedDictionary<object, object>(); |
138 | 129 |
|
139 | 130 | // Then |
140 | | - Assert.Equal(expected, actual); |
| 131 | + Assert.Empty(candidate); |
141 | 132 | } |
142 | 133 |
|
143 | 134 | [Fact(DisplayName = "Collections.EmptyHashSet should produce the expected result")] |
144 | 135 | public void CollectionsEmptyHashSetShouldProduceTheExpectedResult() |
145 | 136 | { |
146 | 137 | // Given |
147 | | - HashSet<object> expected = new(); |
148 | | - HashSet<object> actual = EmptyHashSet<object>(); |
| 138 | + HashSet<object> candidate = EmptyHashSet<object>(); |
149 | 139 |
|
150 | 140 | // Then |
151 | | - Assert.Equal(expected, actual); |
| 141 | + Assert.Empty(candidate); |
152 | 142 | } |
153 | 143 |
|
154 | 144 | [Fact(DisplayName = "Collections.EmptyImmutableHashSet should produce the expected result")] |
155 | 145 | public void CollectionsEmptyImmutableHashSetShouldProduceTheExpectedResult() |
156 | 146 | { |
157 | 147 | // Given |
158 | | - ImmutableHashSet<object> expected = ImmutableHashSet.Create<object>(); |
159 | | - ImmutableHashSet<object> actual = EmptyImmutableHashSet<object>(); |
| 148 | + ImmutableHashSet<object> candidate = EmptyImmutableHashSet<object>(); |
160 | 149 |
|
161 | 150 | // Then |
162 | | - Assert.Equal(expected, actual); |
| 151 | + Assert.Empty(candidate); |
163 | 152 | } |
164 | 153 |
|
165 | 154 | [Fact(DisplayName = "Collections.EmptySortedSet should produce the expected result")] |
166 | 155 | public void CollectionsEmptySortedSetShouldProduceTheExpectedResult() |
167 | 156 | { |
168 | 157 | // Given |
169 | | - SortedSet<object> expected = new(); |
170 | | - SortedSet<object> actual = EmptySortedSet<object>(); |
| 158 | + SortedSet<object> candidate = EmptySortedSet<object>(); |
171 | 159 |
|
172 | 160 | // Then |
173 | | - Assert.Equal(expected, actual); |
| 161 | + Assert.Empty(candidate); |
174 | 162 | } |
175 | 163 |
|
176 | 164 | [Fact(DisplayName = "Collections.EmptyImmutableSortedSet should produce the expected result")] |
177 | 165 | public void CollectionsEmptyImmutableSortedSetShouldProduceTheExpectedResult() |
178 | 166 | { |
179 | 167 | // Given |
180 | | - ImmutableSortedSet<object> expected = ImmutableSortedSet.Create<object>(); |
181 | | - ImmutableSortedSet<object> actual = EmptyImmutableSortedSet<object>(); |
| 168 | + ImmutableSortedSet<object> candidate = EmptyImmutableSortedSet<object>(); |
182 | 169 |
|
183 | 170 | // Then |
184 | | - Assert.Equal(expected, actual); |
| 171 | + Assert.Empty(candidate); |
185 | 172 | } |
186 | 173 |
|
187 | 174 | [Fact(DisplayName = "Collections.EmptyStack should produce the expected result")] |
188 | 175 | public void CollectionsEmptyStackShouldProduceTheExpectedResult() |
189 | 176 | { |
190 | 177 | // Given |
191 | | - Stack<object> expected = new(); |
192 | | - Stack<object> actual = EmptyStack<object>(); |
| 178 | + Stack<object> candidate = EmptyStack<object>(); |
193 | 179 |
|
194 | 180 | // Then |
195 | | - Assert.Equal(expected, actual); |
| 181 | + Assert.Empty(candidate); |
196 | 182 | } |
197 | 183 |
|
198 | 184 | [Fact(DisplayName = "Collections.EmptyImmutableStack should produce the expected result")] |
199 | 185 | public void CollectionsEmptyImmutableStackShouldProduceTheExpectedResult() |
200 | 186 | { |
201 | 187 | // Given |
202 | | - ImmutableStack<object> expected = ImmutableStack.Create<object>(); |
203 | | - ImmutableStack<object> actual = EmptyImmutableStack<object>(); |
| 188 | + ImmutableStack<object> candidate = EmptyImmutableStack<object>(); |
204 | 189 |
|
205 | 190 | // Then |
206 | | - Assert.Equal(expected, actual); |
| 191 | + Assert.Empty(candidate); |
207 | 192 | } |
208 | 193 |
|
209 | 194 | [Fact(DisplayName = "Collections.EmptyQueue should produce the expected result")] |
210 | 195 | public void CollectionsEmptyQueueShouldProduceTheExpectedResult() |
211 | 196 | { |
212 | 197 | // Given |
213 | | - Queue<object> expected = new(); |
214 | | - Queue<object> actual = EmptyQueue<object>(); |
| 198 | + Queue<object> candidate = EmptyQueue<object>(); |
215 | 199 |
|
216 | 200 | // Then |
217 | | - Assert.Equal(expected, actual); |
| 201 | + Assert.Empty(candidate); |
218 | 202 | } |
219 | 203 |
|
220 | 204 | [Fact(DisplayName = "Collections.EmptyImmutableQueue should produce the expected result")] |
221 | 205 | public void CollectionsEmptyImmutableQueueShouldProduceTheExpectedResult() |
222 | 206 | { |
223 | 207 | // Given |
224 | | - ImmutableQueue<object> expected = ImmutableQueue.Create<object>(); |
225 | | - ImmutableQueue<object> actual = EmptyImmutableQueue<object>(); |
| 208 | + ImmutableQueue<object> candidate = EmptyImmutableQueue<object>(); |
226 | 209 |
|
227 | 210 | // Then |
228 | | - Assert.Equal(expected, actual); |
| 211 | + Assert.Empty(candidate); |
229 | 212 | } |
230 | 213 |
|
231 | 214 | [Fact(DisplayName = "Collections.EnumerableOf should return the expected result")] |
|
0 commit comments