|
7 | 7 |
|
8 | 8 | namespace Xamarin.MacDev.Tasks {
|
9 | 9 | [TestFixture]
|
10 |
| - public class GetPropertyListValueTaskTests : TestBase |
11 |
| - { |
| 10 | + public class GetPropertyListValueTaskTests : TestBase { |
12 | 11 |
|
13 | 12 | void TestExecuteTask (string property, string expected)
|
14 | 13 | {
|
@@ -133,75 +132,91 @@ public void TestGetDateProperty ()
|
133 | 132 | }
|
134 | 133 |
|
135 | 134 | [Test]
|
136 |
| - public void TestGetArrayIndexProperty () |
| 135 | + public void TestGetArrayIndexOutOfBounds () |
137 | 136 | {
|
138 |
| - for (var index = 0; index < 3; index++) |
139 |
| - { |
140 |
| - var property = $"KeyArray:{index}"; |
141 |
| - var expected = $"Array Item {index}"; |
| 137 | + var property = $"KeyArray:99"; |
142 | 138 |
|
143 |
| - TestExecuteTask (property, expected); |
144 |
| - } |
| 139 | + TestExecuteTask(property, null); |
145 | 140 | }
|
146 | 141 |
|
147 | 142 | [Test]
|
148 |
| - public void TestGetArrayArrayIndexProperty () |
| 143 | + [TestCase(0)] |
| 144 | + [TestCase(1)] |
| 145 | + [TestCase(2)] |
| 146 | + public void TestGetArrayIndexProperty (int index) |
149 | 147 | {
|
150 |
| - for (var index = 0; index < 3; index++) |
151 |
| - { |
152 |
| - var property = $"KeyArray:3:{index}"; |
153 |
| - var expected = $"Array Array Item 3.{index}"; |
| 148 | + var property = $"KeyArray:{index}"; |
| 149 | + var expected = $"Array Item {index}"; |
154 | 150 |
|
155 |
| - TestExecuteTask (property, expected); |
156 |
| - } |
| 151 | + TestExecuteTask(property, expected); |
157 | 152 | }
|
158 | 153 |
|
159 | 154 | [Test]
|
160 |
| - public void TestGetArrayDictionaryKeyProperty () |
| 155 | + [TestCase(0)] |
| 156 | + [TestCase(1)] |
| 157 | + [TestCase(2)] |
| 158 | + public void TestGetArrayArrayIndexProperty (int index) |
161 | 159 | {
|
162 |
| - for (var index = 0; index < 3; index++) |
163 |
| - { |
164 |
| - var property = $"KeyArray:4:Item{index}"; |
165 |
| - var expected = $"Array Dictionary Item 4.{index}"; |
| 160 | + var property = $"KeyArray:3:{index}"; |
| 161 | + var expected = $"Array Array Item 3.{index}"; |
166 | 162 |
|
167 |
| - TestExecuteTask (property, expected); |
168 |
| - } |
| 163 | + TestExecuteTask (property, expected); |
169 | 164 | }
|
170 | 165 |
|
171 | 166 | [Test]
|
172 |
| - public void TestGetDictionaryKeyProperty () |
| 167 | + [TestCase(0)] |
| 168 | + [TestCase(1)] |
| 169 | + [TestCase(2)] |
| 170 | + public void TestGetArrayDictionaryKeyProperty (int index) |
173 | 171 | {
|
174 |
| - for (var index = 0; index < 3; index++) |
175 |
| - { |
176 |
| - var property = $"KeyDictionary:Item{index}"; |
177 |
| - var expected = $"Dictionary Item {index}"; |
| 172 | + var property = $"KeyArray:4:Item{index}"; |
| 173 | + var expected = $"Array Dictionary Item 4.{index}"; |
178 | 174 |
|
179 |
| - TestExecuteTask (property, expected); |
180 |
| - } |
| 175 | + TestExecuteTask (property, expected); |
181 | 176 | }
|
182 | 177 |
|
183 | 178 | [Test]
|
184 |
| - public void TestGetDictionaryDictionaryKeyProperty () |
| 179 | + public void TestGetDictionaryKeyNotFound () |
185 | 180 | {
|
186 |
| - for (var index = 0; index < 3; index++) |
187 |
| - { |
188 |
| - var property = $"KeyDictionary:Item3:Item{index}"; |
189 |
| - var expected = $"Dictionary Dictionary Item 3.{index}"; |
| 181 | + var property = $"KeyDictionary:ItemKeyNotFound"; |
190 | 182 |
|
191 |
| - TestExecuteTask (property, expected); |
192 |
| - } |
| 183 | + TestExecuteTask (property, null); |
193 | 184 | }
|
194 | 185 |
|
195 | 186 | [Test]
|
196 |
| - public void TestGetDictionaryArrayKeyProperty () |
| 187 | + [TestCase(0)] |
| 188 | + [TestCase(1)] |
| 189 | + [TestCase(2)] |
| 190 | + public void TestGetDictionaryKeyProperty (int index) |
197 | 191 | {
|
198 |
| - for (var index = 0; index < 3; index++) |
199 |
| - { |
200 |
| - var property = $"KeyDictionary:Item4:{index}"; |
201 |
| - var expected = $"Dictionary Array Item 4.{index}"; |
| 192 | + var property = $"KeyDictionary:Item{index}"; |
| 193 | + var expected = $"Dictionary Item {index}"; |
202 | 194 |
|
203 |
| - TestExecuteTask (property, expected); |
204 |
| - } |
| 195 | + TestExecuteTask (property, expected); |
| 196 | + } |
| 197 | + |
| 198 | + [Test] |
| 199 | + [TestCase(0)] |
| 200 | + [TestCase(1)] |
| 201 | + [TestCase(2)] |
| 202 | + public void TestGetDictionaryDictionaryKeyProperty (int index) |
| 203 | + { |
| 204 | + var property = $"KeyDictionary:Item3:Item{index}"; |
| 205 | + var expected = $"Dictionary Dictionary Item 3.{index}"; |
| 206 | + |
| 207 | + TestExecuteTask (property, expected); |
| 208 | + } |
| 209 | + |
| 210 | + [Test] |
| 211 | + [TestCase(0)] |
| 212 | + [TestCase(1)] |
| 213 | + [TestCase(2)] |
| 214 | + public void TestGetDictionaryArrayKeyProperty (int index) |
| 215 | + { |
| 216 | + var property = $"KeyDictionary:Item4:{index}"; |
| 217 | + var expected = $"Dictionary Array Item 4.{index}"; |
| 218 | + |
| 219 | + TestExecuteTask (property, expected); |
205 | 220 | }
|
206 | 221 |
|
207 | 222 | }
|
|
0 commit comments