File tree Expand file tree Collapse file tree 1 file changed +39
-3
lines changed
sdk/test/Services/DynamoDBv2/UnitTests/Custom Expand file tree Collapse file tree 1 file changed +39
-3
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ public void TestConvertingMapIfNullSet()
92
92
Assert . AreEqual ( "testvalue" , dynamoDocument [ "testmap" ] . AsDocument ( ) [ "test" ] . AsString ( ) ) ;
93
93
}
94
94
95
-
96
95
[ TestMethod ]
97
96
[ TestCategory ( "DynamoDBv2" ) ]
98
97
public void TestConvertingListContainsEmptyMapToJson ( )
@@ -113,13 +112,50 @@ public void TestConvertingListContainsEmptyMapToJson()
113
112
} ;
114
113
115
114
var document = Document . FromAttributeMap ( initialAttributeMap ) ;
116
- var result = document . ToJson ( ) ;
117
-
115
+ var result = document . ToJson ( ) ;
118
116
119
117
Assert . IsNotNull ( result ) ;
120
118
Assert . AreEqual ( document [ "testlist" ] . AsListOfDocument ( ) . Count , 0 ) ;
121
119
}
122
120
121
+ [ TestMethod ]
122
+ [ DataRow ( @"{
123
+ ""Lists"": {
124
+ ""L"": [
125
+ {
126
+ ""M"": {
127
+ ""SubLists"": {
128
+ ""L"": [
129
+ {
130
+ ""M"": {}
131
+ }
132
+ ]
133
+ }
134
+ }
135
+ }
136
+ ]
137
+ }
138
+ }" ) ]
139
+ [ DataRow ( @"{
140
+ ""Lists"": {
141
+ ""L"": [
142
+ {
143
+ ""M"": {}
144
+ }
145
+ ]
146
+ }
147
+ }" ) ]
148
+ [ TestCategory ( "DynamoDBv2" ) ]
149
+ public void TestJsonContainsEmptyMapToDocumentAndBackToJson ( string json )
150
+ {
151
+ var initialAttributeMap = Document . FromJson ( json ) . ToAttributeMap ( ) ;
152
+
153
+ var document = Document . FromAttributeMap ( initialAttributeMap ) ;
154
+ var result = document . ToJson ( ) ;
155
+
156
+ Assert . IsNotNull ( result ) ;
157
+ }
158
+
123
159
private static List < Type > GetSubTypes ( Type baseType )
124
160
{
125
161
var assembly = baseType . Assembly ;
You can’t perform that action at this time.
0 commit comments