@@ -1009,30 +1009,30 @@ public void CreateResource_Works_ToAppendDynamicProperties_ForOpenEntityType()
1009
1009
Assert . Equal ( 6 , resource . Properties . Count ( ) ) ;
1010
1010
1011
1011
// Verify the declared properties
1012
- ODataProperty street = Assert . Single ( resource . Properties . Where ( p => p . Name == "CustomerId" ) ) ;
1012
+ ODataProperty street = Assert . IsType < ODataProperty > ( Assert . Single ( resource . Properties . Where ( p => p . Name == "CustomerId" ) ) ) ;
1013
1013
Assert . Equal ( 991 , street . Value ) ;
1014
1014
1015
- ODataProperty city = Assert . Single ( resource . Properties . Where ( p => p . Name == "Name" ) ) ;
1015
+ ODataProperty city = Assert . IsType < ODataProperty > ( Assert . Single ( resource . Properties . Where ( p => p . Name == "Name" ) ) ) ;
1016
1016
Assert . Equal ( "Name #991" , city . Value ) ;
1017
1017
1018
1018
// Verify the nested open complex property
1019
1019
Assert . Empty ( resource . Properties . Where ( p => p . Name == "Address" ) ) ;
1020
1020
1021
1021
// Verify the dynamic properties
1022
- ODataProperty enumProperty = Assert . Single ( resource . Properties . Where ( p => p . Name == "EnumProperty" ) ) ;
1022
+ ODataProperty enumProperty = Assert . IsType < ODataProperty > ( Assert . Single ( resource . Properties . Where ( p => p . Name == "EnumProperty" ) ) ) ;
1023
1023
ODataEnumValue enumValue = Assert . IsType < ODataEnumValue > ( enumProperty . Value ) ;
1024
1024
Assert . Equal ( "Fourth" , enumValue . Value ) ;
1025
1025
Assert . Equal ( "Default.SimpleEnum" , enumValue . TypeName ) ;
1026
1026
1027
- ODataProperty guidProperty = Assert . Single ( resource . Properties . Where ( p => p . Name == "GuidProperty" ) ) ;
1027
+ ODataProperty guidProperty = Assert . IsType < ODataProperty > ( Assert . Single ( resource . Properties . Where ( p => p . Name == "GuidProperty" ) ) ) ;
1028
1028
Assert . Equal ( new Guid ( "181D3A20-B41A-489F-9F15-F91F0F6C9ECA" ) , guidProperty . Value ) ;
1029
1029
1030
- ODataProperty listProperty = Assert . Single ( resource . Properties . Where ( p => p . Name == "ListProperty" ) ) ;
1030
+ ODataProperty listProperty = Assert . IsType < ODataProperty > ( Assert . Single ( resource . Properties . Where ( p => p . Name == "ListProperty" ) ) ) ;
1031
1031
ODataCollectionValue collectionValue = Assert . IsType < ODataCollectionValue > ( listProperty . Value ) ;
1032
1032
Assert . Equal ( new List < int > { 5 , 4 , 3 , 2 , 1 } , collectionValue . Items . OfType < int > ( ) . ToList ( ) ) ;
1033
1033
Assert . Equal ( "Collection(Edm.Int32)" , collectionValue . TypeName ) ;
1034
1034
1035
- ODataProperty dateTimeProperty = Assert . Single ( resource . Properties . Where ( p => p . Name == "DateTimeProperty" ) ) ;
1035
+ ODataProperty dateTimeProperty = Assert . IsType < ODataProperty > ( Assert . Single ( resource . Properties . Where ( p => p . Name == "DateTimeProperty" ) ) ) ;
1036
1036
Assert . Equal ( new DateTimeOffset ( dateTime ) , dateTimeProperty . Value ) ;
1037
1037
}
1038
1038
@@ -1101,20 +1101,20 @@ public void CreateResource_Works_ToAppendNullDynamicProperties_ForOpenEntityType
1101
1101
Assert . Equal ( 4 , resource . Properties . Count ( ) ) ;
1102
1102
1103
1103
// Verify the declared properties
1104
- ODataProperty street = Assert . Single ( resource . Properties . Where ( p => p . Name == "CustomerId" ) ) ;
1104
+ ODataProperty street = Assert . IsType < ODataProperty > ( Assert . Single ( resource . Properties . Where ( p => p . Name == "CustomerId" ) ) ) ;
1105
1105
Assert . Equal ( 991 , street . Value ) ;
1106
1106
1107
- ODataProperty city = Assert . Single ( resource . Properties . Where ( p => p . Name == "Name" ) ) ;
1107
+ ODataProperty city = Assert . IsType < ODataProperty > ( Assert . Single ( resource . Properties . Where ( p => p . Name == "Name" ) ) ) ;
1108
1108
Assert . Equal ( "Name #991" , city . Value ) ;
1109
1109
1110
1110
// Verify the nested open complex property
1111
1111
Assert . Empty ( resource . Properties . Where ( p => p . Name == "Address" ) ) ;
1112
1112
1113
1113
// Verify the dynamic properties
1114
- ODataProperty guidProperty = Assert . Single ( resource . Properties . Where ( p => p . Name == "GuidProperty" ) ) ;
1114
+ ODataProperty guidProperty = Assert . IsType < ODataProperty > ( Assert . Single ( resource . Properties . Where ( p => p . Name == "GuidProperty" ) ) ) ;
1115
1115
Assert . Equal ( new Guid ( "181D3A20-B41A-489F-9F15-F91F0F6C9ECA" ) , guidProperty . Value ) ;
1116
1116
1117
- ODataProperty nullProperty = resource . Properties . Single ( p => p . Name == "NullProperty" ) ;
1117
+ ODataProperty nullProperty = resource . Properties . OfType < ODataProperty > ( ) . Single ( p => p . Name == "NullProperty" ) ;
1118
1118
Assert . Null ( nullProperty . Value ) ;
1119
1119
}
1120
1120
@@ -1183,7 +1183,7 @@ public void CreateResource_Works_ToIgnoreDynamicPropertiesWithEmptyNames_ForOpen
1183
1183
Assert . Equal ( 3 , resource . Properties . Count ( ) ) ;
1184
1184
1185
1185
// Verify properties with empty names are ignored
1186
- ODataProperty emptyProperty = resource . Properties . SingleOrDefault ( p => p . Name == "" ) ;
1186
+ ODataProperty emptyProperty = resource . Properties . OfType < ODataProperty > ( ) . SingleOrDefault ( p => p . Name == "" ) ;
1187
1187
Assert . Null ( emptyProperty ) ;
1188
1188
}
1189
1189
@@ -2333,7 +2333,7 @@ public async Task WriteObjectInlineAsync_Writes_Nested_Entities_Without_Navigati
2333
2333
2334
2334
// Assert
2335
2335
stream . Position = 0 ;
2336
- using ( StreamReader reader = new StreamReader ( stream ) )
2336
+ using ( StreamReader reader = new StreamReader ( stream , leaveOpen : true ) )
2337
2337
{
2338
2338
string response = reader . ReadToEnd ( ) ;
2339
2339
Assert . Contains ( @"""ProductID"":1" , response ) ;
0 commit comments