@@ -504,6 +504,27 @@ public void TypeTesting(string expression, Type type)
504
504
[ TestCase ( "new List<string>{ \" Hello\" , \" Test\" }.Count" , ExpectedResult = 2 , Category = "Create instance with new Keyword, Collection Initializer" ) ]
505
505
[ TestCase ( "new List<string>{ \" Hello\" , \" Test\" }[0]" , ExpectedResult = "Hello" , Category = "Create instance with new Keyword, Collection Initializer" ) ]
506
506
[ TestCase ( "new List<string>{ \" Hello\" , \" Test\" }[1]" , ExpectedResult = "Test" , Category = "Create instance with new Keyword, Collection Initializer" ) ]
507
+ [ TestCase ( "new ClassForTest1(){ IntProperty = 100, StringProperty = \" A Text\" }.GetType()" , ExpectedResult = typeof ( ClassForTest1 ) , Category = "Create instance with new Keyword, Object Initializer" ) ]
508
+ [ TestCase ( "new ClassForTest1(){ IntProperty = 100, StringProperty = \" A Text\" }.IntProperty" , ExpectedResult = 100 , Category = "Create instance with new Keyword, Object Initializer" ) ]
509
+ [ TestCase ( "new ClassForTest1(){ IntProperty = 100, StringProperty = \" A Text\" }.StringProperty" , ExpectedResult = "A Text" , Category = "Create instance with new Keyword, Object Initializer" ) ]
510
+ [ TestCase ( "new ClassForTest1{ IntProperty = 100, StringProperty = \" A Text\" }.GetType()" , ExpectedResult = typeof ( ClassForTest1 ) , Category = "Create instance with new Keyword, Object Initializer" ) ]
511
+ [ TestCase ( "new ClassForTest1{ IntProperty = 100, StringProperty = \" A Text\" }.IntProperty" , ExpectedResult = 100 , Category = "Create instance with new Keyword, Object Initializer" ) ]
512
+ [ TestCase ( "new ClassForTest1{ IntProperty = 100, StringProperty = \" A Text\" }.StringProperty" , ExpectedResult = "A Text" , Category = "Create instance with new Keyword, Object Initializer" ) ]
513
+ [ TestCase ( "new ClassForTest2(10){ Value2 = 100 }.GetType()" , ExpectedResult = typeof ( ClassForTest2 ) , Category = "Create instance with new Keyword, Object Initializer" ) ]
514
+ [ TestCase ( "new ClassForTest2(10){ Value2 = 100 }.Value1" , ExpectedResult = 10 , Category = "Create instance with new Keyword, Object Initializer" ) ]
515
+ [ TestCase ( "new ClassForTest2(10){ Value2 = 100 }.Value2" , ExpectedResult = 100 , Category = "Create instance with new Keyword, Object Initializer" ) ]
516
+ [ TestCase ( "new Dictionary<int, string>(){ [7] = \" seven\" , [7+2] = \" nine\" }.GetType()" , ExpectedResult = typeof ( Dictionary < int , string > ) , Category = "Create instance with new Keyword, Object Initializer" ) ]
517
+ [ TestCase ( "new Dictionary<int, string>(){ [7] = \" seven\" , [7+2] = \" nine\" }[7]" , ExpectedResult = "seven" , Category = "Create instance with new Keyword, Object Initializer" ) ]
518
+ [ TestCase ( "new Dictionary<int, string>(){ [7] = \" seven\" , [7+2] = \" nine\" }[9]" , ExpectedResult = "nine" , Category = "Create instance with new Keyword, Object Initializer" ) ]
519
+ [ TestCase ( "new Dictionary<int, string>{ [7] = \" seven\" , [7+2] = \" nine\" }.GetType()" , ExpectedResult = typeof ( Dictionary < int , string > ) , Category = "Create instance with new Keyword, Object Initializer" ) ]
520
+ [ TestCase ( "new Dictionary<int, string>{ [7] = \" seven\" , [7+2] = \" nine\" }[7]" , ExpectedResult = "seven" , Category = "Create instance with new Keyword, Object Initializer" ) ]
521
+ [ TestCase ( "new Dictionary<int, string>{ [7] = \" seven\" , [7+2] = \" nine\" }[9]" , ExpectedResult = "nine" , Category = "Create instance with new Keyword, Object Initializer" ) ]
522
+ [ TestCase ( "new Dictionary<string, int>(){ [\" seven\" ] = 7, [\" nine\" ] = 9 }.GetType()" , ExpectedResult = typeof ( Dictionary < string , int > ) , Category = "Create instance with new Keyword, Object Initializer" ) ]
523
+ [ TestCase ( "new Dictionary<string, int>(){ [\" seven\" ] = 7, [\" nine\" ] = 9 }[\" seven\" ]" , ExpectedResult = 7 , Category = "Create instance with new Keyword, Object Initializer" ) ]
524
+ [ TestCase ( "new Dictionary<string, int>(){ [\" seven\" ] = 7, [\" nine\" ] = 9 }[\" nine\" ]" , ExpectedResult = 9 , Category = "Create instance with new Keyword, Object Initializer" ) ]
525
+ [ TestCase ( "new Dictionary<string, int>{ [\" seven\" ] = 7, [\" nine\" ] = 9 }.GetType()" , ExpectedResult = typeof ( Dictionary < string , int > ) , Category = "Create instance with new Keyword, Object Initializer" ) ]
526
+ [ TestCase ( "new Dictionary<string, int>{ [\" seven\" ] = 7, [\" nine\" ] = 9 }[\" seven\" ]" , ExpectedResult = 7 , Category = "Create instance with new Keyword, Object Initializer" ) ]
527
+ [ TestCase ( "new Dictionary<string, int>{ [\" seven\" ] = 7, [\" nine\" ] = 9 }[\" nine\" ]" , ExpectedResult = 9 , Category = "Create instance with new Keyword, Object Initializer" ) ]
507
528
508
529
#endregion
509
530
0 commit comments