@@ -105,6 +105,13 @@ public void MessageDeserialization()
105105 {
106106 RestrictedPackageName = "test-pkg-name" ,
107107 } ,
108+ Apns = new ApnsConfig ( )
109+ {
110+ Aps = new Aps ( )
111+ {
112+ AlertString = "test-alert" ,
113+ } ,
114+ } ,
108115 Webpush = new WebpushConfig ( )
109116 {
110117 Data = new Dictionary < string , string > ( ) { { "key" , "value" } } ,
@@ -118,6 +125,7 @@ public void MessageDeserialization()
118125 Assert . Equal ( original . Notification . Body , copy . Notification . Body ) ;
119126 Assert . Equal (
120127 original . Android . RestrictedPackageName , copy . Android . RestrictedPackageName ) ;
128+ Assert . Equal ( original . Apns . Aps . AlertString , copy . Apns . Aps . AlertString ) ;
121129 Assert . Equal ( original . Webpush . Data , copy . Webpush . Data ) ;
122130 }
123131
@@ -130,13 +138,15 @@ public void MessageCopy()
130138 Data = new Dictionary < string , string > ( ) ,
131139 Notification = new Notification ( ) ,
132140 Android = new AndroidConfig ( ) ,
141+ Apns = new ApnsConfig ( ) ,
133142 Webpush = new WebpushConfig ( ) ,
134143 } ;
135144 var copy = original . CopyAndValidate ( ) ;
136145 Assert . NotSame ( original , copy ) ;
137146 Assert . NotSame ( original . Data , copy . Data ) ;
138147 Assert . NotSame ( original . Notification , copy . Notification ) ;
139148 Assert . NotSame ( original . Android , copy . Android ) ;
149+ Assert . NotSame ( original . Apns , copy . Apns ) ;
140150 Assert . NotSame ( original . Webpush , copy . Webpush ) ;
141151 }
142152
@@ -1075,6 +1085,22 @@ public void ApnsCriticalSoundMinimal()
10751085 AssertJsonEquals ( expected , message ) ;
10761086 }
10771087
1088+ [ Fact ]
1089+ public void ApnsCriticalSoundDeserialization ( )
1090+ {
1091+ var original = new CriticalSound ( )
1092+ {
1093+ Name = "default" ,
1094+ Volume = 0.5 ,
1095+ Critical = true ,
1096+ } ;
1097+ var json = NewtonsoftJsonSerializer . Instance . Serialize ( original ) ;
1098+ var copy = NewtonsoftJsonSerializer . Instance . Deserialize < CriticalSound > ( json ) ;
1099+ Assert . Equal ( original . Name , copy . Name ) ;
1100+ Assert . Equal ( original . Volume . Value , copy . Volume . Value ) ;
1101+ Assert . Equal ( original . Critical , copy . Critical ) ;
1102+ }
1103+
10781104 [ Fact ]
10791105 public void ApnsApsAlert ( )
10801106 {
@@ -1211,6 +1237,25 @@ public void ApsAlertDeserialization()
12111237 Assert . Equal ( original . TitleLocKey , copy . TitleLocKey ) ;
12121238 }
12131239
1240+ [ Fact ]
1241+ public void ApsAlertCopy ( )
1242+ {
1243+ var original = new ApsAlert ( )
1244+ {
1245+ LocArgs = new List < string > ( ) { "arg1" , "arg2" } ,
1246+ LocKey = "loc-key" ,
1247+ SubtitleLocArgs = new List < string > ( ) { "arg3" , "arg4" } ,
1248+ SubtitleLocKey = "subtitle-key" ,
1249+ TitleLocArgs = new List < string > ( ) { "arg5" , "arg6" } ,
1250+ TitleLocKey = "title-key" ,
1251+ } ;
1252+ var copy = original . CopyAndValidate ( ) ;
1253+ Assert . NotSame ( original , copy ) ;
1254+ Assert . NotSame ( original . LocArgs , copy . LocArgs ) ;
1255+ Assert . NotSame ( original . SubtitleLocArgs , copy . SubtitleLocArgs ) ;
1256+ Assert . NotSame ( original . TitleLocArgs , copy . TitleLocArgs ) ;
1257+ }
1258+
12141259 [ Fact ]
12151260 public void ApnsApsAlertInvalidTitleLocArgs ( )
12161261 {
0 commit comments