|
1 | | -namespace Python.EmbeddingTest { |
| 1 | +namespace Python.EmbeddingTest |
| 2 | +{ |
2 | 3 | using System; |
3 | 4 | using System.Collections.Generic; |
4 | 5 | using System.Linq; |
| 6 | + |
5 | 7 | using NUnit.Framework; |
| 8 | + |
6 | 9 | using Python.Runtime; |
7 | 10 | using Python.Runtime.Codecs; |
8 | 11 |
|
@@ -169,7 +172,8 @@ public void SequenceDecoderTest() |
169 | 172 | ICollection<string> stringCollection = null; |
170 | 173 | Assert.DoesNotThrow(() => { codec.TryDecode(pyList, out stringCollection); }); |
171 | 174 | Assert.AreEqual(3, stringCollection.Count()); |
172 | | - Assert.Throws(typeof(InvalidCastException), () => { |
| 175 | + Assert.Throws(typeof(InvalidCastException), () => |
| 176 | + { |
173 | 177 | string[] array = new string[3]; |
174 | 178 | stringCollection.CopyTo(array, 0); |
175 | 179 | }); |
@@ -206,7 +210,8 @@ public void SequenceDecoderTest() |
206 | 210 | ICollection<string> stringCollection2 = null; |
207 | 211 | Assert.DoesNotThrow(() => { codec.TryDecode(pyTuple, out stringCollection2); }); |
208 | 212 | Assert.AreEqual(3, stringCollection2.Count()); |
209 | | - Assert.Throws(typeof(InvalidCastException), () => { |
| 213 | + Assert.Throws(typeof(InvalidCastException), () => |
| 214 | + { |
210 | 215 | string[] array = new string[3]; |
211 | 216 | stringCollection2.CopyTo(array, 0); |
212 | 217 | }); |
@@ -255,13 +260,15 @@ public void IterableDecoderTest() |
255 | 260 | IEnumerable<string> stringEnumerable = null; |
256 | 261 | Assert.DoesNotThrow(() => { codec.TryDecode(pyList, out stringEnumerable); }); |
257 | 262 |
|
258 | | - Assert.Throws(typeof(InvalidCastException), () => { |
| 263 | + Assert.Throws(typeof(InvalidCastException), () => |
| 264 | + { |
259 | 265 | foreach (string item in stringEnumerable) |
260 | 266 | { |
261 | 267 | var x = item; |
262 | 268 | } |
263 | 269 | }); |
264 | | - Assert.Throws(typeof(InvalidCastException), () => { |
| 270 | + Assert.Throws(typeof(InvalidCastException), () => |
| 271 | + { |
265 | 272 | stringEnumerable.Count(); |
266 | 273 | }); |
267 | 274 |
|
@@ -390,7 +397,7 @@ public void ExceptionDecodedNoInstance() |
390 | 397 | } |
391 | 398 | } |
392 | 399 |
|
393 | | - public static void AcceptsDateTime(DateTime v) {} |
| 400 | + public static void AcceptsDateTime(DateTime v) { } |
394 | 401 |
|
395 | 402 | [Test] |
396 | 403 | public void As_Object_AffectedByDecoders() |
|
0 commit comments