@@ -35,7 +35,7 @@ describe("FormSerializationWriter", () => {
35
35
testEntity . additionalData [ "createdDateTime" ] = new Date ( 0 ) ;
36
36
testEntity . deviceNames = [ "device1" , "device2" ] ;
37
37
testEntity . status = LongRunningOperationStatusObject . NotStarted ;
38
- testEntity . nextStatuses = [ LongRunningOperationStatusObject . Running , LongRunningOperationStatusObject . Succeeded ] ;
38
+ // testEntity.nextStatuses = [LongRunningOperationStatusObject.Running, LongRunningOperationStatusObject.Succeeded];
39
39
const formSerializationWriter = new FormSerializationWriter ( ) ;
40
40
formSerializationWriter . writeObjectValue ( undefined , testEntity , serializeTestEntity ) ;
41
41
const formContent = formSerializationWriter . getSerializedContent ( ) ;
@@ -54,8 +54,6 @@ describe("FormSerializationWriter", () => {
54
54
"officeLocation=null" , // Serializes null values
55
55
"endWorkTime=null" , // Serializes null values
56
56
"status=notStarted" , // Serializes enum values
57
- "nextStatuses=running" ,
58
- "nextStatuses=succeeded" , // Serializes collections of enum values
59
57
] ;
60
58
const arr = form . split ( "&" ) ;
61
59
let count = 0 ;
@@ -70,6 +68,15 @@ describe("FormSerializationWriter", () => {
70
68
assert . equal ( arr . length , 0 ) ;
71
69
} ) ;
72
70
71
+ it ( "writeCollectionOfEnumValues" , ( ) => {
72
+ const enums = [ LongRunningOperationStatusObject . Running , LongRunningOperationStatusObject . Succeeded ] ;
73
+ const formSerializationWriter = new FormSerializationWriter ( ) ;
74
+ formSerializationWriter . writeCollectionOfEnumValue ( "nextStatuses" , enums ) ;
75
+ const formContent = formSerializationWriter . getSerializedContent ( ) ;
76
+ const form = new TextDecoder ( ) . decode ( formContent ) ;
77
+ assert . equal ( "nextStatuses=running&nextStatuses=succeeded&" , form ) ;
78
+ } ) ;
79
+
73
80
it ( "writesSampleCollectionOfObjectValues" , ( ) => {
74
81
const testEntity = { } as TestEntity ;
75
82
testEntity . id = "48d31887-5fad-4d73-a9f5-3c356e68a038" ;
0 commit comments