@@ -94,11 +94,11 @@ public void TestConvertingMapIfNullSet()
94
94
95
95
[ TestMethod ]
96
96
[ TestCategory ( "DynamoDBv2" ) ]
97
- public void TestConvertingListContainsEmptyMapToJson ( )
97
+ public void TestConvertingEmptyListToJson ( )
98
98
{
99
99
var initialAttributeMap = new Dictionary < string , AttributeValue >
100
100
{
101
- { "testlist" , new AttributeValue
101
+ { "Lists" , new AttributeValue
102
102
{
103
103
L = new List < AttributeValue >
104
104
{
@@ -112,52 +112,51 @@ public void TestConvertingListContainsEmptyMapToJson()
112
112
} ;
113
113
114
114
var document = Document . FromAttributeMap ( initialAttributeMap ) ;
115
- var result = document . ToJson ( ) ;
116
- document = Document . FromAttributeMap ( document . ToAttributeMap ( ) ) ;
115
+ Assert . AreEqual ( document [ "Lists" ] . AsListOfDocument ( ) . Count , 0 ) ;
117
116
118
- Assert . IsNotNull ( document ) ;
119
- Assert . IsNotNull ( result ) ;
120
- Assert . AreEqual ( document [ "testlist" ] . AsListOfDocument ( ) . Count , 0 ) ;
117
+ var jsonString = document . ToJson ( ) ;
118
+ Assert . IsNotNull ( jsonString ) ;
121
119
}
122
120
123
121
[ TestMethod ]
122
+ [ TestCategory ( "DynamoDBv2" ) ]
124
123
[ DataRow ( @"{
125
- ""Lists"": {
126
- ""L"": [
127
- {
128
- ""M"": {
129
- ""SubLists"": {
130
- ""L"": [
131
- {
132
- ""M"": {}
133
- }
134
- ]
135
- }
136
- }
137
- }
138
- ]
139
- }
124
+ ""Lists"": {
125
+ ""L"": [
126
+ {
127
+ ""M"": {
128
+ ""SubLists"": {
129
+ ""L"": [
130
+ {
131
+ ""M"": {}
132
+ }
133
+ ]
134
+ }
135
+ }
136
+ }
137
+ ]
138
+ }
140
139
}" ) ]
141
140
[ DataRow ( @"{
142
- ""Lists"": {
143
- ""L"": [
144
- {
145
- ""M"": {}
146
- }
147
- ]
148
- }
141
+ ""Lists"": {
142
+ ""L"": [
143
+ {
144
+ ""M"": {}
145
+ }
146
+ ]
147
+ }
149
148
}" ) ]
150
- [ TestCategory ( "DynamoDBv2" ) ]
151
149
public void TestJsonContainsEmptyMapToDocumentAndBackToJson ( string json )
152
150
{
153
- var initialAttributeMap = Document . FromJson ( json ) . ToAttributeMap ( ) ;
154
-
155
- var document = Document . FromAttributeMap ( initialAttributeMap ) ;
156
- var result = document . ToJson ( ) ;
157
- document = Document . FromAttributeMap ( document . ToAttributeMap ( ) ) ;
151
+ var initialDocument = Document . FromJson ( json ) ;
152
+ Assert . IsNotNull ( initialDocument ) ;
153
+
154
+ var initialAttributeMap = initialDocument . ToAttributeMap ( ) ;
155
+ var convertedDocument = Document . FromAttributeMap ( initialAttributeMap ) ;
156
+ Assert . IsNotNull ( convertedDocument ) ;
158
157
159
- Assert . IsNotNull ( document ) ;
160
- Assert . IsNotNull ( result ) ;
158
+ var jsonString = convertedDocument . ToJson ( ) ;
159
+ Assert . IsNotNull ( jsonString ) ;
161
160
}
162
161
163
162
private static List < Type > GetSubTypes ( Type baseType )
0 commit comments