@@ -20,16 +20,8 @@ namespace Microsoft.Azure.Functions.PowerShellWorker.Test
20
20
{
21
21
public class TypeExtensionsTests
22
22
{
23
- private readonly ConsoleLogger _testLogger ;
24
- private readonly PowerShellManager _testManager ;
25
-
26
- public TypeExtensionsTests ( )
27
- {
28
- _testLogger = new ConsoleLogger ( ) ;
29
- _testManager = TestUtils . NewTestPowerShellManager ( _testLogger ) ;
30
- }
31
-
32
23
#region TypedDataToObject
24
+
33
25
[ Fact ]
34
26
public void TestTypedDataToObjectHttpRequestContextBasic ( )
35
27
{
@@ -343,7 +335,7 @@ public void TestObjectToTypedDataRpcHttpBasic()
343
335
}
344
336
} ;
345
337
346
- Assert . Equal ( expected , input . ToTypedData ( null ) ) ;
338
+ Assert . Equal ( expected , input . ToTypedData ( ) ) ;
347
339
}
348
340
349
341
[ Fact ]
@@ -366,7 +358,7 @@ public void TestObjectToTypedDataRpcHttpContentTypeSet()
366
358
}
367
359
} ;
368
360
369
- Assert . Equal ( expected , input . ToTypedData ( null ) ) ;
361
+ Assert . Equal ( expected , input . ToTypedData ( ) ) ;
370
362
}
371
363
372
364
[ Fact ]
@@ -389,7 +381,7 @@ public void TestObjectToTypedDataRpcHttpContentTypeInHeader()
389
381
}
390
382
} ;
391
383
392
- Assert . Equal ( expected , input . ToTypedData ( null ) ) ;
384
+ Assert . Equal ( expected , input . ToTypedData ( ) ) ;
393
385
}
394
386
395
387
[ Fact ]
@@ -412,7 +404,7 @@ public void TestObjectToTypedDataRpcHttpStatusCodeString()
412
404
}
413
405
} ;
414
406
415
- Assert . Equal ( expected , input . ToTypedData ( null ) ) ;
407
+ Assert . Equal ( expected , input . ToTypedData ( ) ) ;
416
408
}
417
409
418
410
[ Fact ]
@@ -426,7 +418,7 @@ public void TestObjectToTypedDataInt()
426
418
Int = data
427
419
} ;
428
420
429
- Assert . Equal ( expected , input . ToTypedData ( null ) ) ;
421
+ Assert . Equal ( expected , input . ToTypedData ( ) ) ;
430
422
}
431
423
432
424
[ Fact ]
@@ -440,7 +432,7 @@ public void TestObjectToTypedDataDouble()
440
432
Double = data
441
433
} ;
442
434
443
- Assert . Equal ( expected , input . ToTypedData ( null ) ) ;
435
+ Assert . Equal ( expected , input . ToTypedData ( ) ) ;
444
436
}
445
437
446
438
[ Fact ]
@@ -454,7 +446,7 @@ public void TestObjectToTypedDataString()
454
446
String = data
455
447
} ;
456
448
457
- Assert . Equal ( expected , input . ToTypedData ( null ) ) ;
449
+ Assert . Equal ( expected , input . ToTypedData ( ) ) ;
458
450
}
459
451
460
452
[ Fact ]
@@ -468,7 +460,7 @@ public void TestObjectToTypedDataBytes()
468
460
Bytes = ByteString . CopyFrom ( data )
469
461
} ;
470
462
471
- Assert . Equal ( expected , input . ToTypedData ( null ) ) ;
463
+ Assert . Equal ( expected , input . ToTypedData ( ) ) ;
472
464
}
473
465
474
466
[ Fact ]
@@ -483,7 +475,7 @@ public void TestObjectToTypedDataStream()
483
475
Stream = ByteString . FromStream ( data )
484
476
} ;
485
477
486
- Assert . Equal ( expected , input . ToTypedData ( null ) ) ;
478
+ Assert . Equal ( expected , input . ToTypedData ( ) ) ;
487
479
}
488
480
}
489
481
@@ -498,7 +490,7 @@ public void TestObjectToTypedDataJsonString()
498
490
Json = data
499
491
} ;
500
492
501
- Assert . Equal ( expected , input . ToTypedData ( null ) ) ;
493
+ Assert . Equal ( expected , input . ToTypedData ( ) ) ;
502
494
}
503
495
504
496
[ Fact ]
@@ -512,7 +504,7 @@ public void TestObjectToTypedDataJsonHashtable()
512
504
Json = "{\" foo\" :\" bar\" }"
513
505
} ;
514
506
515
- Assert . Equal ( expected , input . ToTypedData ( _testManager ) ) ;
507
+ Assert . Equal ( expected , input . ToTypedData ( ) ) ;
516
508
}
517
509
518
510
[ Fact ]
@@ -526,7 +518,7 @@ public void TestObjectToTypedData_PSObjectToJson_1()
526
518
Json = "{\" foo\" :\" bar\" }"
527
519
} ;
528
520
529
- Assert . Equal ( expected , input . ToTypedData ( _testManager ) ) ;
521
+ Assert . Equal ( expected , input . ToTypedData ( ) ) ;
530
522
}
531
523
532
524
[ Fact ]
@@ -541,7 +533,7 @@ public void TestObjectToTypedData_PSObjectToJson_2()
541
533
Json = "{\" foo\" :\" bar\" }"
542
534
} ;
543
535
544
- Assert . Equal ( expected , input . ToTypedData ( _testManager ) ) ;
536
+ Assert . Equal ( expected , input . ToTypedData ( ) ) ;
545
537
}
546
538
}
547
539
@@ -551,7 +543,7 @@ public void TestObjectToTypedData_PSObjectToBytes()
551
543
var data = new byte [ ] { 12 , 23 , 34 } ;
552
544
object input = PSObject . AsPSObject ( data ) ;
553
545
554
- TypedData output = input . ToTypedData ( _testManager ) ;
546
+ TypedData output = input . ToTypedData ( ) ;
555
547
556
548
Assert . Equal ( TypedData . DataOneofCase . Bytes , output . DataCase ) ;
557
549
Assert . Equal ( 3 , output . Bytes . Length ) ;
@@ -563,7 +555,7 @@ public void TestObjectToTypedData_PSObjectToStream()
563
555
using ( var data = new MemoryStream ( new byte [ ] { 12 , 23 , 34 } ) )
564
556
{
565
557
object input = PSObject . AsPSObject ( data ) ;
566
- TypedData output = input . ToTypedData ( _testManager ) ;
558
+ TypedData output = input . ToTypedData ( ) ;
567
559
568
560
Assert . Equal ( TypedData . DataOneofCase . Stream , output . DataCase ) ;
569
561
Assert . Equal ( 3 , output . Stream . Length ) ;
@@ -574,7 +566,7 @@ public void TestObjectToTypedData_PSObjectToStream()
574
566
public void TestObjectToTypedData_PSObjectToString ( )
575
567
{
576
568
object input = PSObject . AsPSObject ( "Hello World" ) ;
577
- TypedData output = input . ToTypedData ( _testManager ) ;
569
+ TypedData output = input . ToTypedData ( ) ;
578
570
579
571
Assert . Equal ( TypedData . DataOneofCase . String , output . DataCase ) ;
580
572
Assert . Equal ( "Hello World" , output . String ) ;
0 commit comments