1
use aetolia::prelude::*;
2

            
3
4
pub fn make_test_object() -> ICalObject {
4
4
    let fancy_language_tag = LanguageTag::new("en")
5
4
        .with_ext_lang("tst")
6
4
        .with_script("Test")
7
4
        .with_region("US")
8
4
        .add_variant("test1")
9
4
        .add_variant("test2")
10
4
        .add_extension("u-co-phonebk")
11
4
        .add_extension("u-nu-latn")
12
4
        .with_private_use("x-TST");
13
4

            
14
4
    ICalObject::builder()
15
4
        // RFC 5545: 3.7.1
16
4
        .add_calendar_scale("gregorian")
17
4
        .add_iana_param("scale-test", "test")
18
4
        .add_x_param("x-scale-test", "test")
19
4
        .finish_property()
20
4
        // RFC 5545: 3.7.2
21
4
        .add_method("publish")
22
4
        .add_iana_param("method-test", "test")
23
4
        .add_x_param("x-method-test", "test")
24
4
        .finish_property()
25
4
        // RFC 5545: 3.7.3
26
4
        .add_product_id("aetolia/test")
27
4
        .add_iana_param("product-id-test", "test")
28
4
        .add_x_param("x-product-id-test", "test")
29
4
        .finish_property()
30
4
        // RFC 5545: 3.7.4
31
4
        .add_max_version("2.0")
32
4
        .add_iana_param("max-version-test", "test")
33
4
        .add_x_param("x-max-version-test", "test")
34
4
        .finish_property()
35
4
        // RFC 5545: 3.6.1 - with properties added in the order they appear in the spec
36
4
        .add_event_component()
37
4
        // RFC 5545: 3.8.7.2
38
4
        .add_date_time_stamp(
39
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
40
4
            time::Time::from_hms(15, 0, 0).unwrap(),
41
4
        )
42
4
        .set_is_utc()
43
4
        .add_iana_param("date-time-stamp-test", "test")
44
4
        .add_x_param("x-date-time-stamp-test", "test")
45
4
        .finish_property()
46
4
        // RFC 5545: 3.8.4.7
47
4
        .add_unique_identifier("test-id")
48
4
        .add_iana_param("unique-identifier-test", "test")
49
4
        .add_x_param("x-unique-identifier-test", "test")
50
4
        .finish_property()
51
4
        // RFC 5545: 3.8.2.4
52
4
        .add_date_time_start(
53
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
54
4
            Some(time::Time::from_hms(15, 0, 0).unwrap()),
55
4
        )
56
4
        .add_tz_id("test", true)
57
4
        .add_iana_param("date-time-start-test", "test")
58
4
        .add_x_param("x-date-time-start-test", "test")
59
4
        .finish_property()
60
4
        // RFC 5545: 3.8.1.3
61
4
        .add_classification(Classification::Public)
62
4
        .add_iana_param("classification-test", "test")
63
4
        .add_x_param("x-classification-test", "test")
64
4
        .finish_property()
65
4
        // RFC 5545: 3.8.7.1
66
4
        .add_date_time_created(
67
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
68
4
            time::Time::from_hms(15, 0, 0).unwrap(),
69
4
        )
70
4
        .add_iana_param("created-test", "test")
71
4
        .add_x_param("x-created-test", "test")
72
4
        .finish_property()
73
4
        // RFC 5545: 3.8.1.5
74
4
        .add_description("test")
75
4
        .add_alternate_representation("http://example.com/test")
76
4
        .add_language(fancy_language_tag.clone())
77
4
        .add_iana_param("description-test", "test")
78
4
        .add_x_param("x-description-test", "test")
79
4
        .finish_property()
80
4
        // RFC 5545: 3.8.1.6
81
4
        .add_geographic_position(3.111, 4.2)
82
4
        .add_iana_param("geo-test", "test")
83
4
        .add_x_param("x-geo-test", "test")
84
4
        .finish_property()
85
4
        // RFC 5545: 3.8.7.3
86
4
        .add_last_modified(
87
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
88
4
            time::Time::from_hms(15, 0, 0).unwrap(),
89
4
        )
90
4
        .set_is_utc()
91
4
        .add_iana_param("last-modified-test", "test")
92
4
        .add_x_param("x-last-modified-test", "test")
93
4
        .finish_property()
94
4
        // RFC 5545: 3.8.1.7
95
4
        .add_location("test")
96
4
        .add_alternate_representation("http://example.com/test")
97
4
        .add_language(fancy_language_tag.clone())
98
4
        .add_iana_param("location-test", "test")
99
4
        .add_x_param("x-location-test", "test")
100
4
        .finish_property()
101
4
        // RFC 5545: 3.8.4.3
102
4
        .add_organizer("mailto:hello@test.net")
103
4
        .add_common_name("test")
104
4
        .add_directory_entry_reference("http://example.com/test")
105
4
        .add_sent_by("mailto:hello@test.net")
106
4
        .add_language(fancy_language_tag.clone())
107
4
        .add_iana_param("organizer-test", "test")
108
4
        .add_x_param("x-organizer-test", "test")
109
4
        .finish_property()
110
4
        // RFC 5545: 3.8.1.9
111
4
        .add_priority(1)
112
4
        .add_iana_param("priority-test", "test")
113
4
        .add_x_param("x-priority-test", "test")
114
4
        .finish_property()
115
4
        // RFC 5545: 3.8.7.4
116
4
        .add_sequence(300)
117
4
        .add_iana_param("sequence-test", "test")
118
4
        .add_x_param("x-sequence-test", "test")
119
4
        .finish_property()
120
4
        // RFC 5545: 3.8.1.11
121
4
        .add_status(StatusEvent::Confirmed)
122
4
        .add_iana_param("status-test", "test")
123
4
        .add_x_param("x-status-test", "test")
124
4
        .finish_property()
125
4
        // RFC 5545: 3.8.1.12
126
4
        .add_summary("test")
127
4
        .add_alternate_representation("http://example.com/test")
128
4
        .add_language(fancy_language_tag.clone())
129
4
        .add_iana_param("summary-test", "test")
130
4
        .add_x_param("x-summary-test", "test")
131
4
        .finish_property()
132
4
        // RFC 5545: 3.8.2.7
133
4
        .add_time_transparency(TimeTransparency::Opaque)
134
4
        .add_iana_param("time-transparency-test", "test")
135
4
        .add_x_param("x-time-transparency-test", "test")
136
4
        .finish_property()
137
4
        // RFC 5545: 3.8.4.6
138
4
        .add_url("http://example.com/test")
139
4
        .add_iana_param("url-test", "test")
140
4
        .add_x_param("x-url-test", "test")
141
4
        .finish_property()
142
4
        // RFC 5545: 3.8.4.4
143
4
        .add_recurrence_id(
144
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
145
4
            Some(time::Time::from_hms(15, 0, 0).unwrap()),
146
4
        )
147
4
        .add_tz_id("test", true)
148
4
        .add_range(Range::ThisAndFuture)
149
4
        .add_iana_param("recurrence-id-test", "test")
150
4
        .add_x_param("x-recurrence-id-test", "test")
151
4
        .finish_property()
152
4
        // RFC 5545: 3.8.5.3
153
6
        .add_recurrence_rule(RecurFreq::Yearly, |rule| {
154
4
            // Likely a junk rule, it's just to check that everything is settable and round trips correctly
155
4
            rule.set_until(
156
4
                (
157
4
                    time::Date::from_calendar_date(2035, time::Month::August, 20).unwrap(),
158
4
                    time::Time::from_hms(15, 0, 0).unwrap(),
159
4
                    true,
160
4
                )
161
4
                    .into(),
162
4
            )
163
4
            .set_count(1_000)
164
4
            .set_interval(4)
165
4
            .set_by_second(vec![1, 2, 3])
166
4
            .set_by_minute(vec![1, 2, 3])
167
4
            .set_by_hour(vec![1, 2, 3])
168
4
            .set_by_day(vec![OffsetWeekday::new(Weekday::Monday, None)])
169
4
            .set_by_month_day(vec![1, 2, 3])
170
4
            .set_by_year_day(vec![1, 2, 3])
171
4
            .set_by_week_number(vec![1, 2, 3])
172
4
            .set_by_month(vec![
173
4
                time::Month::January,
174
4
                time::Month::February,
175
4
                time::Month::March,
176
4
            ])
177
4
            .set_by_set_pos(vec![1, 2, 3])
178
4
            .set_week_start(Weekday::Monday)
179
6
        })
180
4
        .add_iana_param("recurrence-rule-test", "test")
181
4
        .add_x_param("x-recurrence-rule-test", "test")
182
4
        .finish_property()
183
4
        // RFC 5545: 3.8.2.2
184
4
        .add_date_time_end(
185
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
186
4
            Some(time::Time::from_hms(15, 0, 0).unwrap()),
187
4
        )
188
4
        .add_tz_id("test", true)
189
4
        .add_iana_param("date-time-end-test", "test")
190
4
        .add_x_param("x-date-time-end-test", "test")
191
4
        .finish_property()
192
4
        // RFC 5545: 3.8.1.1
193
4
        .add_attach_uri("http://example.com/test")
194
4
        .add_fmt_type("text", "xml")
195
4
        .add_iana_param("attach-test", "test")
196
4
        .add_x_param("x-attach-test", "test")
197
4
        .finish_property()
198
4
        // RFC 5545: 3.8.4.1
199
4
        .add_attendee("http:video-call.test.net")
200
4
        .add_calendar_user_type(CalendarUserType::Room)
201
4
        .add_members(vec!["video:video-call.test.net"])
202
4
        .add_role(Role::NonParticipant)
203
4
        .add_participation_status(ParticipationStatusEvent::Accepted)
204
4
        .add_rsvp()
205
4
        .add_delegated_to(vec!["http:video-call-1.test.net"])
206
4
        .add_delegated_from(vec!["http:video-call-2.test.net"])
207
4
        .add_sent_by("mailto:info@test.net")
208
4
        .add_common_name("test")
209
4
        .add_directory_entry_reference("CID:hello")
210
4
        .add_language(fancy_language_tag.clone())
211
4
        .add_iana_param("attendee-test", "test")
212
4
        .add_x_param("x-attendee-test", "test")
213
4
        .finish_property()
214
4
        // RFC 5545: 3.8.1.2
215
4
        .add_categories(vec!["test1", "test2", "test3"])
216
4
        .add_language(fancy_language_tag.clone())
217
4
        .add_iana_param("categories-test", "test")
218
4
        .add_x_param("x-categories-test", "test")
219
4
        .finish_property()
220
4
        // RFC 5545: 3.8.1.4
221
4
        .add_comment("test")
222
4
        .add_alternate_representation("http://example.com/test")
223
4
        .add_language(fancy_language_tag.clone())
224
4
        .add_iana_param("comment-test", "test")
225
4
        .add_x_param("x-comment-test", "test")
226
4
        .finish_property()
227
4
        // RFC 5545: 3.8.4.2
228
4
        .add_contact("mailto:admin@test.net")
229
4
        .add_alternate_representation("http://example.com/test")
230
4
        .add_language(fancy_language_tag.clone())
231
4
        .add_iana_param("contact-test", "test")
232
4
        .add_x_param("x-contact-test", "test")
233
4
        .finish_property()
234
4
        // RFC 5545: 3.8.5.1
235
4
        .add_exception_date_times(vec![
236
4
            (
237
4
                time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
238
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
239
4
                true,
240
4
            )
241
4
                .into(),
242
4
            (
243
4
                time::Date::from_calendar_date(2024, time::Month::August, 9).unwrap(),
244
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
245
4
                true,
246
4
            )
247
4
                .into(),
248
4
        ])
249
4
        .add_tz_id("test", true)
250
4
        .add_iana_param("exception-date-times-test", "test")
251
4
        .add_x_param("x-exception-date-times-test", "test")
252
4
        .finish_property()
253
4
        // RFC 5545: 3.8.8.3
254
4
        .add_request_status(&[2, 1], "Success", Some("great event"))
255
4
        .add_language(fancy_language_tag.clone())
256
4
        .add_iana_param("request-status-test", "test")
257
4
        .add_x_param("x-request-status-test", "test")
258
4
        .finish_property()
259
4
        // RFC 5545: 3.8.4.5
260
4
        .add_related_to("some-other-event")
261
4
        .add_relationship_type(RelationshipType::Parent)
262
4
        .add_iana_param("related-to-test", "test")
263
4
        .add_x_param("x-related-to-test", "test")
264
4
        .finish_property()
265
4
        // RFC 5545: 3.8.1.10
266
4
        .add_resources(vec!["test1", "test2", "test3"])
267
4
        .add_alternate_representation("http://example.com/test")
268
4
        .add_language(fancy_language_tag.clone())
269
4
        .add_iana_param("resources-test", "test")
270
4
        .add_x_param("x-resources-test", "test")
271
4
        .finish_property()
272
4
        // RFC 5545: 3.8.5.2
273
4
        .add_recurrence_date_date_times(vec![
274
4
            (
275
4
                time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
276
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
277
4
                true,
278
4
            )
279
4
                .into(),
280
4
            (
281
4
                time::Date::from_calendar_date(2024, time::Month::August, 9).unwrap(),
282
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
283
4
                true,
284
4
            )
285
4
                .into(),
286
4
        ])
287
4
        .add_tz_id("test", true)
288
4
        .add_iana_param("recurrence-date-test", "test")
289
4
        .add_x_param("x-recurrence-date-test", "test")
290
4
        .finish_property()
291
4
        // RFC 5545: 3.8.8.1
292
4
        .add_iana_property("other", "some-value")
293
4
        .add_iana_param("other-test", "test")
294
4
        .add_x_param("x-other-test", "test")
295
4
        .finish_property()
296
4
        // RFC 5545: 3.8.8.2
297
4
        .add_x_property("x-other", "some-value")
298
4
        .add_iana_param("x-other-test", "test")
299
4
        .add_x_param("x-x-other-test", "test")
300
4
        .finish_property()
301
4
        .add_audio_alarm()
302
4
        // RFC 5545: 3.8.6.1
303
4
        .add_action()
304
4
        .add_iana_param("action-test", "test")
305
4
        .add_x_param("x-action-test", "test")
306
4
        .finish_property()
307
4
        // RFC 5545: 3.8.6.3
308
4
        .add_relative_trigger(Duration::days(1, 1))
309
4
        .add_trigger_relationship(TriggerRelationship::Start)
310
4
        .add_iana_param("trigger-test", "test")
311
4
        .add_x_param("x-trigger-test", "test")
312
4
        .finish_property()
313
4
        // RFC 5545: 3.8.2.5
314
6
        .add_duration(|| Duration::hours(1, 1).build())
315
4
        .add_iana_param("duration-test", "test")
316
4
        .add_x_param("x-duration-test", "test")
317
4
        .finish_property()
318
4
        // RFC 5545: 3.8.6.2
319
4
        .add_repeat(2)
320
4
        .add_iana_param("repeat-test", "test")
321
4
        .add_x_param("x-repeat-test", "test")
322
4
        .finish_property()
323
4
        // RFC 5545: 3.8.1.1
324
4
        .add_attach_binary("YXNkZg==")
325
4
        .add_iana_param("attach-test", "test")
326
4
        .add_x_param("x-attach-test", "test")
327
4
        .finish_property()
328
4
        // RFC 5545: 3.8.8.1
329
4
        .add_iana_property("other", "some-value")
330
4
        .add_iana_param("other-test", "test")
331
4
        .add_x_param("x-other-test", "test")
332
4
        .finish_property()
333
4
        // RFC 5545: 3.8.8.2
334
4
        .add_x_property("x-other", "some-value")
335
4
        .add_iana_param("x-other-test", "test")
336
4
        .add_x_param("x-x-other-test", "test")
337
4
        .finish_property()
338
4
        .finish_component()
339
4
        .add_display_alarm()
340
4
        .add_action()
341
4
        .finish_property()
342
4
        .add_description("test")
343
4
        .finish_property()
344
4
        // RFC 5545: 3.8.6.3
345
4
        .add_absolute_trigger(
346
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
347
4
            time::Time::from_hms(15, 0, 0).unwrap(),
348
4
        )
349
4
        .add_iana_param("trigger-test", "test")
350
4
        .add_x_param("x-trigger-test", "test")
351
4
        .finish_property()
352
6
        .add_duration(|| Duration::hours(1, 1).build())
353
4
        .finish_property()
354
4
        .add_repeat(2)
355
4
        .finish_property()
356
4
        .add_iana_property("other", "some-value")
357
4
        .finish_property()
358
4
        .add_x_property("x-other", "some-value")
359
4
        .finish_property()
360
4
        .finish_component()
361
4
        .add_email_alarm()
362
4
        .add_action()
363
4
        .finish_property()
364
4
        .add_description("test")
365
4
        .finish_property()
366
4
        .add_relative_trigger(Duration::days(1, 1))
367
4
        .finish_property()
368
4
        .add_summary("test")
369
4
        .finish_property()
370
4
        .add_attendee("mailto:notify@test.net")
371
4
        .finish_property()
372
6
        .add_duration(|| Duration::hours(1, 1).build())
373
4
        .finish_property()
374
4
        .add_repeat(2)
375
4
        .finish_property()
376
4
        .add_attach_uri("http://example.com/test")
377
4
        .finish_property()
378
4
        .add_iana_property("other", "some-value")
379
4
        .finish_property()
380
4
        .add_x_property("x-other-test", "test")
381
4
        .finish_property()
382
4
        .finish_component()
383
4
        .finish_component()
384
4
        .add_to_do_component()
385
4
        // RFC 5545: 3.8.7.2
386
4
        .add_date_time_stamp(
387
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
388
4
            time::Time::from_hms(15, 0, 0).unwrap(),
389
4
        )
390
4
        .set_is_utc()
391
4
        .add_iana_param("date-time-stamp-test", "test")
392
4
        .add_x_param("x-date-time-stamp-test", "test")
393
4
        .finish_property()
394
4
        // RFC 5545: 3.8.4.7
395
4
        .add_unique_identifier("test-id")
396
4
        .add_iana_param("unique-id-test", "test")
397
4
        .add_x_param("x-unique-id-test", "test")
398
4
        .finish_property()
399
4
        // RFC 5545: 3.8.1.3
400
4
        .add_classification(Classification::Public)
401
4
        .add_iana_param("class-test", "test")
402
4
        .add_x_param("x-class-test", "test")
403
4
        .finish_property()
404
4
        // RFC 5545: 3.8.2.1
405
4
        .add_date_time_completed(
406
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
407
4
            time::Time::from_hms(15, 0, 0).unwrap(),
408
4
        )
409
4
        .set_is_utc()
410
4
        .add_iana_param("completed-test", "test")
411
4
        .add_x_param("x-completed-test", "test")
412
4
        .finish_property()
413
4
        // RFC 5545: 3.8.7.1
414
4
        .add_date_time_created(
415
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
416
4
            time::Time::from_hms(15, 0, 0).unwrap(),
417
4
        )
418
4
        .add_iana_param("created-test", "test")
419
4
        .add_x_param("x-created-test", "test")
420
4
        .finish_property()
421
4
        // RFC 5545: 3.8.1.5
422
4
        .add_description("test")
423
4
        .add_alternate_representation("http://example.com/test")
424
4
        .add_language(fancy_language_tag.clone())
425
4
        .add_iana_param("description-test", "test")
426
4
        .add_x_param("x-description-test", "test")
427
4
        .finish_property()
428
4
        // RFC 5545: 3.8.2.4
429
4
        .add_date_time_start(
430
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
431
4
            Some(time::Time::from_hms(15, 0, 0).unwrap()),
432
4
        )
433
4
        .add_tz_id("test", true)
434
4
        .add_iana_param("date-time-start-test", "test")
435
4
        .add_x_param("x-date-time-start-test", "test")
436
4
        .finish_property()
437
4
        // RFC 5545: 3.8.1.6
438
4
        .add_geographic_position(3.111, 4.2)
439
4
        .add_iana_param("geo-test", "test")
440
4
        .add_x_param("x-geo-test", "test")
441
4
        .finish_property()
442
4
        // RFC 5545: 3.8.7.3
443
4
        .add_last_modified(
444
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
445
4
            time::Time::from_hms(15, 0, 0).unwrap(),
446
4
        )
447
4
        .set_is_utc()
448
4
        .add_iana_param("last-modified-test", "test")
449
4
        .add_x_param("x-last-modified-test", "test")
450
4
        .finish_property()
451
4
        // RFC 5545: 3.8.1.7
452
4
        .add_location("test")
453
4
        .add_alternate_representation("http://example.com/test")
454
4
        .add_language(fancy_language_tag.clone())
455
4
        .add_iana_param("location-test", "test")
456
4
        .add_x_param("x-location-test", "test")
457
4
        .finish_property()
458
4
        // RFC 5545: 3.8.4.3
459
4
        .add_organizer("mailto:hello@test.net")
460
4
        .add_common_name("test")
461
4
        .add_directory_entry_reference("http://example.com/test")
462
4
        .add_sent_by("mailto:hello@test.net")
463
4
        .add_language(fancy_language_tag.clone())
464
4
        .add_iana_param("organizer-test", "test")
465
4
        .add_x_param("x-organizer-test", "test")
466
4
        .finish_property()
467
4
        // RFC 5545: 3.8.1.8
468
4
        .add_percent_complete(50)
469
4
        .add_iana_param("percent-complete-test", "test")
470
4
        .add_x_param("x-percent-complete-test", "test")
471
4
        .finish_property()
472
4
        // RFC 5545: 3.8.1.9
473
4
        .add_priority(5)
474
4
        .add_iana_param("priority-test", "test")
475
4
        .add_x_param("x-priority-test", "test")
476
4
        .finish_property()
477
4
        // RFC 5545: 3.8.4.4
478
4
        .add_recurrence_id(
479
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
480
4
            Some(time::Time::from_hms(15, 0, 0).unwrap()),
481
4
        )
482
4
        .add_tz_id("test", true)
483
4
        .add_range(Range::ThisAndFuture)
484
4
        .add_iana_param("recurrence-id-test", "test")
485
4
        .add_x_param("x-recurrence-id-test", "test")
486
4
        .finish_property()
487
4
        // RFC 5545: 3.8.7.4
488
4
        .add_sequence(300)
489
4
        .add_iana_param("sequence-test", "test")
490
4
        .add_x_param("x-sequence-test", "test")
491
4
        .finish_property()
492
4
        // RFC 5545: 3.8.1.11
493
4
        .add_status(StatusToDo::InProcess)
494
4
        .add_iana_param("status-test", "test")
495
4
        .add_x_param("x-status-test", "test")
496
4
        .finish_property()
497
4
        // RFC 5545: 3.8.1.12
498
4
        .add_summary("test")
499
4
        .add_alternate_representation("http://example.com/test")
500
4
        .add_language(fancy_language_tag.clone())
501
4
        .add_iana_param("summary-test", "test")
502
4
        .add_x_param("x-summary-test", "test")
503
4
        .finish_property()
504
4
        // RFC 5545: 3.8.4.6
505
4
        .add_url("http://example.com/test")
506
4
        .add_iana_param("url-test", "test")
507
4
        .add_x_param("x-url-test", "test")
508
4
        .finish_property()
509
4
        // RFC 5545: 3.8.5.3
510
6
        .add_recurrence_rule(RecurFreq::Yearly, |rule| {
511
4
            // Likely a junk rule, it's just to check that everything is settable and round trips correctly
512
4
            rule.set_until(
513
4
                (
514
4
                    time::Date::from_calendar_date(2035, time::Month::August, 20).unwrap(),
515
4
                    time::Time::from_hms(15, 0, 0).unwrap(),
516
4
                    true,
517
4
                )
518
4
                    .into(),
519
4
            )
520
4
            .set_count(1_000)
521
4
            .set_interval(4)
522
4
            .set_by_second(vec![1, 2, 3])
523
4
            .set_by_minute(vec![1, 2, 3])
524
4
            .set_by_hour(vec![1, 2, 3])
525
4
            .set_by_day(vec![OffsetWeekday::new(Weekday::Monday, None)])
526
4
            .set_by_month_day(vec![1, 2, 3])
527
4
            .set_by_year_day(vec![1, 2, 3])
528
4
            .set_by_week_number(vec![1, 2, 3])
529
4
            .set_by_month(vec![
530
4
                time::Month::January,
531
4
                time::Month::February,
532
4
                time::Month::March,
533
4
            ])
534
4
            .set_by_set_pos(vec![1, 2, 3])
535
4
            .set_week_start(Weekday::Monday)
536
6
        })
537
4
        .add_iana_param("recurrence-rule-test", "test")
538
4
        .add_x_param("x-recurrence-rule-test", "test")
539
4
        .finish_property()
540
4
        // RFC 5545: 3.8.2.5
541
6
        .add_duration(|| Duration::hours(1, 1).build())
542
4
        .add_iana_param("duration-test", "test")
543
4
        .add_x_param("x-duration-test", "test")
544
4
        .finish_property()
545
4
        // RFC 5545: 3.8.1.1
546
4
        .add_attach_uri("http://example.com/test")
547
4
        .add_fmt_type("text", "xml")
548
4
        .add_iana_param("attach-test", "test")
549
4
        .add_x_param("x-attach-test", "test")
550
4
        .finish_property()
551
4
        // RFC 5545: 3.8.4.1
552
4
        .add_attendee("http:video-call.test.net")
553
4
        .add_calendar_user_type(CalendarUserType::Room)
554
4
        .add_members(vec!["video:video-call.test.net"])
555
4
        .add_role(Role::NonParticipant)
556
4
        .add_participation_status(ParticipationStatusToDo::NeedsAction)
557
4
        .add_rsvp()
558
4
        .add_delegated_to(vec!["http:video-call-1.test.net"])
559
4
        .add_delegated_from(vec!["http:video-call-2.test.net"])
560
4
        .add_sent_by("mailto:info@test.net")
561
4
        .add_common_name("test")
562
4
        .add_directory_entry_reference("CID:hello")
563
4
        .add_language(fancy_language_tag.clone())
564
4
        .add_iana_param("attendee-test", "test")
565
4
        .add_x_param("x-attendee-test", "test")
566
4
        .finish_property()
567
4
        // RFC 5545: 3.8.1.2
568
4
        .add_categories(vec!["test1", "test2", "test3"])
569
4
        .add_language(fancy_language_tag.clone())
570
4
        .add_iana_param("categories-test", "test")
571
4
        .add_x_param("x-categories-test", "test")
572
4
        .finish_property()
573
4
        // RFC 5545: 3.8.1.4
574
4
        .add_comment("test")
575
4
        .add_alternate_representation("http://example.com/test")
576
4
        .add_language(fancy_language_tag.clone())
577
4
        .add_iana_param("comment-test", "test")
578
4
        .add_x_param("x-comment-test", "test")
579
4
        .finish_property()
580
4
        // RFC 5545: 3.8.4.2
581
4
        .add_contact("mailto:admin@test.net")
582
4
        .add_alternate_representation("http://example.com/test")
583
4
        .add_language(fancy_language_tag.clone())
584
4
        .add_iana_param("contact-test", "test")
585
4
        .add_x_param("x-contact-test", "test")
586
4
        .finish_property()
587
4
        // RFC 5545: 3.8.5.1
588
4
        .add_exception_date_times(vec![
589
4
            (
590
4
                time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
591
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
592
4
                true,
593
4
            )
594
4
                .into(),
595
4
            (
596
4
                time::Date::from_calendar_date(2024, time::Month::August, 9).unwrap(),
597
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
598
4
                true,
599
4
            )
600
4
                .into(),
601
4
        ])
602
4
        .add_tz_id("test", true)
603
4
        .add_iana_param("exception-date-times-test", "test")
604
4
        .add_x_param("x-exception-date-times-test", "test")
605
4
        .finish_property()
606
4
        // RFC 5545: 3.8.8.3
607
4
        .add_request_status(&[2, 1], "Success", Some("great event"))
608
4
        .add_language(fancy_language_tag.clone())
609
4
        .add_iana_param("request-status-test", "test")
610
4
        .add_x_param("x-request-status-test", "test")
611
4
        .finish_property()
612
4
        // RFC 5545: 3.8.4.5
613
4
        .add_related_to("some-other-event")
614
4
        .add_relationship_type(RelationshipType::Parent)
615
4
        .add_iana_param("related-to-test", "test")
616
4
        .add_x_param("x-related-to-test", "test")
617
4
        .finish_property()
618
4
        // RFC 5545: 3.8.1.10
619
4
        .add_resources(vec!["test1", "test2", "test3"])
620
4
        .add_alternate_representation("http://example.com/test")
621
4
        .add_language(fancy_language_tag.clone())
622
4
        .add_iana_param("resources-test", "test")
623
4
        .add_x_param("x-resources-test", "test")
624
4
        .finish_property()
625
4
        // RFC 5545: 3.8.5.2
626
4
        .add_recurrence_date_date_times(vec![
627
4
            (
628
4
                time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
629
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
630
4
                true,
631
4
            )
632
4
                .into(),
633
4
            (
634
4
                time::Date::from_calendar_date(2024, time::Month::August, 9).unwrap(),
635
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
636
4
                true,
637
4
            )
638
4
                .into(),
639
4
        ])
640
4
        .add_tz_id("test", true)
641
4
        .add_iana_param("recurrence-date-test", "test")
642
4
        .add_x_param("x-recurrence-date-test", "test")
643
4
        .finish_property()
644
4
        // RFC 5545: 3.8.8.1
645
4
        .add_iana_property("other", "some-value")
646
4
        .add_iana_param("other-test", "test")
647
4
        .add_x_param("x-other-test", "test")
648
4
        .finish_property()
649
4
        // RFC 5545: 3.8.8.2
650
4
        .add_x_property("x-other", "some-value")
651
4
        .add_iana_param("x-other-test", "test")
652
4
        .add_x_param("x-x-other-test", "test")
653
4
        .finish_property()
654
4
        .add_display_alarm()
655
4
        .add_action()
656
4
        .finish_property()
657
4
        .add_description("test")
658
4
        .finish_property()
659
4
        // RFC 5545: 3.8.6.3
660
4
        .add_absolute_trigger(
661
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
662
4
            time::Time::from_hms(15, 0, 0).unwrap(),
663
4
        )
664
4
        .add_iana_param("trigger-test", "test")
665
4
        .add_x_param("x-trigger-test", "test")
666
4
        .finish_property()
667
6
        .add_duration(|| Duration::hours(1, 1).build())
668
4
        .finish_property()
669
4
        .add_repeat(2)
670
4
        .finish_property()
671
4
        .add_iana_property("other", "some-value")
672
4
        .finish_property()
673
4
        .add_x_property("x-other", "some-value")
674
4
        .finish_property()
675
4
        .finish_component()
676
4
        .finish_component()
677
4
        .add_journal_component()
678
4
        // RFC 5545: 3.8.7.2
679
4
        .add_date_time_stamp(
680
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
681
4
            time::Time::from_hms(15, 0, 0).unwrap(),
682
4
        )
683
4
        .set_is_utc()
684
4
        .add_iana_param("date-time-stamp-test", "test")
685
4
        .add_x_param("x-date-time-stamp-test", "test")
686
4
        .finish_property()
687
4
        // RFC 5545: 3.8.4.7
688
4
        .add_unique_identifier("test-id")
689
4
        .add_iana_param("unique-id-test", "test")
690
4
        .add_x_param("x-unique-id-test", "test")
691
4
        .finish_property()
692
4
        // RFC 5545: 3.8.1.3
693
4
        .add_classification(Classification::Public)
694
4
        .add_iana_param("class-test", "test")
695
4
        .add_x_param("x-class-test", "test")
696
4
        .finish_property()
697
4
        // RFC 5545: 3.8.7.1
698
4
        .add_date_time_created(
699
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
700
4
            time::Time::from_hms(15, 0, 0).unwrap(),
701
4
        )
702
4
        .add_iana_param("created-test", "test")
703
4
        .add_x_param("x-created-test", "test")
704
4
        .finish_property()
705
4
        // RFC 5545: 3.8.2.4
706
4
        .add_date_time_start(
707
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
708
4
            Some(time::Time::from_hms(15, 0, 0).unwrap()),
709
4
        )
710
4
        .add_tz_id("test", true)
711
4
        .add_iana_param("date-time-start-test", "test")
712
4
        .add_x_param("x-date-time-start-test", "test")
713
4
        .finish_property()
714
4
        // RFC 5545: 3.8.7.3
715
4
        .add_last_modified(
716
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
717
4
            time::Time::from_hms(15, 0, 0).unwrap(),
718
4
        )
719
4
        .set_is_utc()
720
4
        .add_iana_param("last-modified-test", "test")
721
4
        .add_x_param("x-last-modified-test", "test")
722
4
        .finish_property()
723
4
        // RFC 5545: 3.8.4.3
724
4
        .add_organizer("mailto:hello@test.net")
725
4
        .add_common_name("test")
726
4
        .add_directory_entry_reference("http://example.com/test")
727
4
        .add_sent_by("mailto:hello@test.net")
728
4
        .add_language(fancy_language_tag.clone())
729
4
        .add_iana_param("organizer-test", "test")
730
4
        .add_x_param("x-organizer-test", "test")
731
4
        .finish_property()
732
4
        // RFC 5545: 3.8.4.4
733
4
        .add_recurrence_id(
734
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
735
4
            Some(time::Time::from_hms(15, 0, 0).unwrap()),
736
4
        )
737
4
        .add_tz_id("test", true)
738
4
        .add_range(Range::ThisAndFuture)
739
4
        .add_iana_param("recurrence-id-test", "test")
740
4
        .add_x_param("x-recurrence-id-test", "test")
741
4
        .finish_property()
742
4
        // RFC 5545: 3.8.7.4
743
4
        .add_sequence(300)
744
4
        .add_iana_param("sequence-test", "test")
745
4
        .add_x_param("x-sequence-test", "test")
746
4
        .finish_property()
747
4
        // RFC 5545: 3.8.1.11
748
4
        .add_status(StatusJournal::Draft)
749
4
        .add_iana_param("status-test", "test")
750
4
        .add_x_param("x-status-test", "test")
751
4
        .finish_property()
752
4
        // RFC 5545: 3.8.1.12
753
4
        .add_summary("test")
754
4
        .add_alternate_representation("http://example.com/test")
755
4
        .add_language(fancy_language_tag.clone())
756
4
        .add_iana_param("summary-test", "test")
757
4
        .add_x_param("x-summary-test", "test")
758
4
        .finish_property()
759
4
        // RFC 5545: 3.8.4.6
760
4
        .add_url("http://example.com/test")
761
4
        .add_iana_param("url-test", "test")
762
4
        .add_x_param("x-url-test", "test")
763
4
        .finish_property()
764
4
        // RFC 5545: 3.8.5.3
765
6
        .add_recurrence_rule(RecurFreq::Yearly, |rule| {
766
4
            // Likely a junk rule, it's just to check that everything is settable and round trips correctly
767
4
            rule.set_until(
768
4
                (
769
4
                    time::Date::from_calendar_date(2035, time::Month::August, 20).unwrap(),
770
4
                    time::Time::from_hms(15, 0, 0).unwrap(),
771
4
                    true,
772
4
                )
773
4
                    .into(),
774
4
            )
775
4
            .set_count(1_000)
776
4
            .set_interval(4)
777
4
            .set_by_second(vec![1, 2, 3])
778
4
            .set_by_minute(vec![1, 2, 3])
779
4
            .set_by_hour(vec![1, 2, 3])
780
4
            .set_by_day(vec![OffsetWeekday::new(Weekday::Monday, None)])
781
4
            .set_by_month_day(vec![1, 2, 3])
782
4
            .set_by_year_day(vec![1, 2, 3])
783
4
            .set_by_week_number(vec![1, 2, 3])
784
4
            .set_by_month(vec![
785
4
                time::Month::January,
786
4
                time::Month::February,
787
4
                time::Month::March,
788
4
            ])
789
4
            .set_by_set_pos(vec![1, 2, 3])
790
4
            .set_week_start(Weekday::Monday)
791
6
        })
792
4
        .add_iana_param("recurrence-rule-test", "test")
793
4
        .add_x_param("x-recurrence-rule-test", "test")
794
4
        .finish_property()
795
4
        // RFC 5545: 3.8.1.1
796
4
        .add_attach_uri("http://example.com/test")
797
4
        .add_fmt_type("text", "xml")
798
4
        .add_iana_param("attach-test", "test")
799
4
        .add_x_param("x-attach-test", "test")
800
4
        .finish_property()
801
4
        // RFC 5545: 3.8.4.1
802
4
        .add_attendee("http:video-call.test.net")
803
4
        .add_calendar_user_type(CalendarUserType::Room)
804
4
        .add_members(vec!["video:video-call.test.net"])
805
4
        .add_role(Role::NonParticipant)
806
4
        .add_participation_status(ParticipationStatusJournal::NeedsAction)
807
4
        .add_rsvp()
808
4
        .add_delegated_to(vec!["http:video-call-1.test.net"])
809
4
        .add_delegated_from(vec!["http:video-call-2.test.net"])
810
4
        .add_sent_by("mailto:info@test.net")
811
4
        .add_common_name("test")
812
4
        .add_directory_entry_reference("CID:hello")
813
4
        .add_language(fancy_language_tag.clone())
814
4
        .add_iana_param("attendee-test", "test")
815
4
        .add_x_param("x-attendee-test", "test")
816
4
        .finish_property()
817
4
        // RFC 5545: 3.8.1.2
818
4
        .add_categories(vec!["test1", "test2", "test3"])
819
4
        .add_language(fancy_language_tag.clone())
820
4
        .add_iana_param("categories-test", "test")
821
4
        .add_x_param("x-categories-test", "test")
822
4
        .finish_property()
823
4
        // RFC 5545: 3.8.1.4
824
4
        .add_comment("test")
825
4
        .add_alternate_representation("http://example.com/test")
826
4
        .add_language(fancy_language_tag.clone())
827
4
        .add_iana_param("comment-test", "test")
828
4
        .add_x_param("x-comment-test", "test")
829
4
        .finish_property()
830
4
        // RFC 5545: 3.8.4.2
831
4
        .add_contact("mailto:admin@test.net")
832
4
        .add_alternate_representation("http://example.com/test")
833
4
        .add_language(fancy_language_tag.clone())
834
4
        .add_iana_param("contact-test", "test")
835
4
        .add_x_param("x-contact-test", "test")
836
4
        .finish_property()
837
4
        // RFC 5545: 3.8.1.5
838
4
        .add_description("test")
839
4
        .add_alternate_representation("http://example.com/test")
840
4
        .add_language(fancy_language_tag.clone())
841
4
        .add_iana_param("description-test", "test")
842
4
        .add_x_param("x-description-test", "test")
843
4
        .finish_property()
844
4
        // RFC 5545: 3.8.5.1
845
4
        .add_exception_date_times(vec![
846
4
            (
847
4
                time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
848
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
849
4
                true,
850
4
            )
851
4
                .into(),
852
4
            (
853
4
                time::Date::from_calendar_date(2024, time::Month::August, 9).unwrap(),
854
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
855
4
                true,
856
4
            )
857
4
                .into(),
858
4
        ])
859
4
        .add_tz_id("test", true)
860
4
        .add_iana_param("exception-date-times-test", "test")
861
4
        .add_x_param("x-exception-date-times-test", "test")
862
4
        .finish_property()
863
4
        // RFC 5545: 3.8.4.5
864
4
        .add_related_to("some-other-event")
865
4
        .add_relationship_type(RelationshipType::Parent)
866
4
        .add_iana_param("related-to-test", "test")
867
4
        .add_x_param("x-related-to-test", "test")
868
4
        .finish_property()
869
4
        // RFC 5545: 3.8.5.2
870
4
        .add_recurrence_date_date_times(vec![
871
4
            (
872
4
                time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
873
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
874
4
                true,
875
4
            )
876
4
                .into(),
877
4
            (
878
4
                time::Date::from_calendar_date(2024, time::Month::August, 9).unwrap(),
879
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
880
4
                true,
881
4
            )
882
4
                .into(),
883
4
        ])
884
4
        .add_tz_id("test", true)
885
4
        .add_iana_param("recurrence-date-test", "test")
886
4
        .add_x_param("x-recurrence-date-test", "test")
887
4
        .finish_property()
888
4
        // RFC 5545: 3.8.8.3
889
4
        .add_request_status(&[2, 1], "Success", Some("great event"))
890
4
        .add_language(fancy_language_tag.clone())
891
4
        .add_iana_param("request-status-test", "test")
892
4
        .add_x_param("x-request-status-test", "test")
893
4
        .finish_property()
894
4
        // RFC 5545: 3.8.8.1
895
4
        .add_iana_property("other", "some-value")
896
4
        .add_iana_param("other-test", "test")
897
4
        .add_x_param("x-other-test", "test")
898
4
        .finish_property()
899
4
        // RFC 5545: 3.8.8.2
900
4
        .add_x_property("x-other", "some-value")
901
4
        .add_iana_param("x-other-test", "test")
902
4
        .add_x_param("x-x-other-test", "test")
903
4
        .finish_property()
904
4
        .finish_component()
905
4
        .add_free_busy_component()
906
4
        // RFC 5545: 3.8.7.2
907
4
        .add_date_time_stamp(
908
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
909
4
            time::Time::from_hms(15, 0, 0).unwrap(),
910
4
        )
911
4
        .set_is_utc()
912
4
        .add_iana_param("date-time-stamp-test", "test")
913
4
        .add_x_param("x-date-time-stamp-test", "test")
914
4
        .finish_property()
915
4
        // RFC 5545: 3.8.4.7
916
4
        .add_unique_identifier("test-id")
917
4
        .add_iana_param("unique-id-test", "test")
918
4
        .add_x_param("x-unique-id-test", "test")
919
4
        .finish_property()
920
4
        // RFC 5545: 3.8.4.2
921
4
        .add_contact("mailto:admin@test.net")
922
4
        .add_alternate_representation("http://example.com/test")
923
4
        .add_language(fancy_language_tag.clone())
924
4
        .add_iana_param("contact-test", "test")
925
4
        .add_x_param("x-contact-test", "test")
926
4
        .finish_property()
927
4
        // RFC 5545: 3.8.2.4
928
4
        .add_date_time_start(
929
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
930
4
            Some(time::Time::from_hms(15, 0, 0).unwrap()),
931
4
        )
932
4
        .set_is_utc()
933
4
        .add_iana_param("date-time-start-test", "test")
934
4
        .add_x_param("x-date-time-start-test", "test")
935
4
        .finish_property()
936
4
        // RFC 5545: 3.8.2.2
937
4
        .add_date_time_end(
938
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
939
4
            Some(time::Time::from_hms(15, 0, 0).unwrap()),
940
4
        )
941
4
        .set_is_utc()
942
4
        .add_iana_param("date-time-end-test", "test")
943
4
        .add_x_param("x-date-time-end-test", "test")
944
4
        .finish_property()
945
4
        // RFC 5545: 3.8.4.3
946
4
        .add_organizer("mailto:hello@test.net")
947
4
        .add_common_name("test")
948
4
        .add_directory_entry_reference("http://example.com/test")
949
4
        .add_sent_by("mailto:hello@test.net")
950
4
        .add_language(fancy_language_tag.clone())
951
4
        .add_iana_param("organizer-test", "test")
952
4
        .add_x_param("x-organizer-test", "test")
953
4
        .finish_property()
954
4
        // RFC 5545: 3.8.4.6
955
4
        .add_url("http://example.com/test")
956
4
        .add_iana_param("url-test", "test")
957
4
        .add_x_param("x-url-test", "test")
958
4
        .finish_property()
959
4
        // RFC 5545: 3.8.4.1
960
4
        .add_attendee("http:video-call.test.net")
961
4
        .add_language(fancy_language_tag.clone())
962
4
        .add_iana_param("attendee-test", "test")
963
4
        .add_x_param("x-attendee-test", "test")
964
4
        .finish_property()
965
4
        // RFC 5545: 3.8.1.4
966
4
        .add_comment("test")
967
4
        .add_alternate_representation("http://example.com/test")
968
4
        .add_language(fancy_language_tag.clone())
969
4
        .add_iana_param("comment-test", "test")
970
4
        .add_x_param("x-comment-test", "test")
971
4
        .finish_property()
972
4
        // RFC 5545: 3.8.2.6
973
4
        .add_free_busy_time(
974
4
            FreeBusyTimeType::BusyTentative,
975
4
            vec![
976
4
                Period::new_explicit(
977
4
                    time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
978
4
                    time::Time::from_hms(15, 0, 0).unwrap(),
979
4
                    time::Date::from_calendar_date(2024, time::Month::August, 9).unwrap(),
980
4
                    time::Time::from_hms(15, 0, 0).unwrap(),
981
4
                    true,
982
4
                ),
983
4
                Period::new_start(
984
4
                    time::Date::from_calendar_date(2024, time::Month::August, 10).unwrap(),
985
4
                    time::Time::from_hms(15, 0, 0).unwrap(),
986
4
                    true,
987
4
                    Duration::weeks(1, 3),
988
4
                ),
989
4
            ],
990
4
        )
991
4
        .add_iana_param("free-busy-time-test", "test")
992
4
        .add_x_param("x-free-busy-time-test", "test")
993
4
        .finish_property()
994
4
        // RFC 5545: 3.8.8.3
995
4
        .add_request_status(&[2, 1], "Success", Some("great event"))
996
4
        .add_language(fancy_language_tag.clone())
997
4
        .add_iana_param("request-status-test", "test")
998
4
        .add_x_param("x-request-status-test", "test")
999
4
        .finish_property()
4
        // RFC 5545: 3.8.8.1
4
        .add_iana_property("other", "some-value")
4
        .add_iana_param("other-test", "test")
4
        .add_x_param("x-other-test", "test")
4
        .finish_property()
4
        // RFC 5545: 3.8.8.2
4
        .add_x_property("x-other", "some-value")
4
        .add_iana_param("x-other-test", "test")
4
        .add_x_param("x-x-other-test", "test")
4
        .finish_property()
4
        .finish_component()
4
        .add_time_zone_component()
4
        // RFC 5545: 3.8.3.1
4
        .add_time_zone_id("test", false)
4
        .add_iana_param("time-zone-id-test", "test")
4
        .add_x_param("x-time-zone-id-test", "test")
4
        .finish_property()
4
        // RFC 5545: 3.8.7.3
4
        .add_last_modified(
4
            time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
4
            time::Time::from_hms(15, 0, 0).unwrap(),
4
        )
4
        .set_is_utc()
4
        .add_iana_param("last-modified-test", "test")
4
        .add_x_param("x-last-modified-test", "test")
4
        .finish_property()
4
        // RFC 5545: 3.8.3.5
4
        .add_time_zone_url("http://example.com/test")
4
        .add_iana_param("time-zone-url-test", "test")
4
        .add_x_param("x-time-zone-url-test", "test")
4
        .finish_property()
4
        // RFC 5545: 3.8.8.1
4
        .add_iana_property("other", "some-value")
4
        .add_iana_param("other-test", "test")
4
        .add_x_param("x-other-test", "test")
4
        .finish_property()
4
        // RFC 5545: 3.8.8.2
4
        .add_x_property("x-other", "some-value")
4
        .add_iana_param("x-other-test", "test")
4
        .add_x_param("x-x-other-test", "test")
4
        .finish_property()
6
        .add_standard_time(|b| {
4
            // RFC 5545: 3.8.2.4
4
            b.add_date_time_start(
4
                time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
4
            )
4
            .add_iana_param("date-time-start-test", "test")
4
            .add_x_param("x-date-time-start-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.3.4
4
            .add_time_zone_offset_to(TimeZoneOffset::new(1, 5, 0, None))
4
            .add_iana_param("time-zone-offset-to-test", "test")
4
            .add_x_param("x-time-zone-offset-to-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.3.3
4
            .add_time_zone_offset_from(TimeZoneOffset::new(-1, 5, 0, None))
4
            .add_iana_param("time-zone-offset-from-test", "test")
4
            .add_x_param("x-time-zone-offset-from-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.5.3
4
            .add_recurrence_rule(RecurFreq::Yearly, |rule| {
4
                // Likely a junk rule, it's just to check that everything is settable and round trips correctly
4
                rule.set_until(
4
                    (
4
                        time::Date::from_calendar_date(2035, time::Month::August, 20).unwrap(),
4
                        time::Time::from_hms(15, 0, 0).unwrap(),
4
                        true,
4
                    )
4
                        .into(),
4
                )
4
                .set_count(1_000)
4
                .set_interval(4)
4
                .set_by_second(vec![1, 2, 3])
4
                .set_by_minute(vec![1, 2, 3])
4
                .set_by_hour(vec![1, 2, 3])
4
                .set_by_day(vec![OffsetWeekday::new(Weekday::Monday, None)])
4
                .set_by_month_day(vec![1, 2, 3])
4
                .set_by_year_day(vec![1, 2, 3])
4
                .set_by_week_number(vec![1, 2, 3])
4
                .set_by_month(vec![
4
                    time::Month::January,
4
                    time::Month::February,
4
                    time::Month::March,
4
                ])
4
                .set_by_set_pos(vec![1, 2, 3])
4
                .set_week_start(Weekday::Monday)
4
            })
4
            .add_iana_param("recurrence-rule-test", "test")
4
            .add_x_param("x-recurrence-rule-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.1.4
4
            .add_comment("test")
4
            .add_alternate_representation("http://example.com/test")
4
            .add_language(LanguageTag::new("en").with_region("US"))
4
            .add_iana_param("comment-test", "test")
4
            .add_x_param("x-comment-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.5.2
4
            .add_recurrence_date_date_times(vec![
4
                (
4
                    time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
4
                    Some(time::Time::from_hms(15, 0, 0).unwrap()),
4
                    true,
4
                )
4
                    .into(),
4
                (
4
                    time::Date::from_calendar_date(2024, time::Month::August, 9).unwrap(),
4
                    Some(time::Time::from_hms(15, 0, 0).unwrap()),
4
                    true,
4
                )
4
                    .into(),
4
            ])
4
            .add_tz_id("test", true)
4
            .add_iana_param("recurrence-date-test", "test")
4
            .add_x_param("x-recurrence-date-test", "test")
4
            .finish_property()
4
            .add_time_zone_name("test")
4
            .add_iana_param("time-zone-name-test", "test")
4
            .add_x_param("x-time-zone-name-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.8.1
4
            .add_iana_property("other", "some-value")
4
            .add_iana_param("other-test", "test")
4
            .add_x_param("x-other-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.8.2
4
            .add_x_property("x-other", "some-value")
4
            .add_iana_param("x-other-test", "test")
4
            .add_x_param("x-x-other-test", "test")
4
            .finish_property()
6
        })
6
        .add_daylight_time(|b| {
4
            // RFC 5545: 3.8.2.4
4
            b.add_date_time_start(
4
                time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
4
                Some(time::Time::from_hms(15, 0, 0).unwrap()),
4
            )
4
            .add_iana_param("date-time-start-test", "test")
4
            .add_x_param("x-date-time-start-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.3.4
4
            .add_time_zone_offset_to(TimeZoneOffset::new(1, 4, 0, None))
4
            .add_iana_param("time-zone-offset-to-test", "test")
4
            .add_x_param("x-time-zone-offset-to-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.3.3
4
            .add_time_zone_offset_from(TimeZoneOffset::new(-1, 4, 0, None))
4
            .add_iana_param("time-zone-offset-from-test", "test")
4
            .add_x_param("x-time-zone-offset-from-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.5.3
4
            .add_recurrence_rule(RecurFreq::Yearly, |rule| {
4
                // Likely a junk rule, it's just to check that everything is settable and round trips correctly
4
                rule.set_until(
4
                    (
4
                        time::Date::from_calendar_date(2035, time::Month::August, 20).unwrap(),
4
                        time::Time::from_hms(15, 0, 0).unwrap(),
4
                        true,
4
                    )
4
                        .into(),
4
                )
4
                .set_count(1_000)
4
                .set_interval(4)
4
                .set_by_second(vec![1, 2, 3])
4
                .set_by_minute(vec![1, 2, 3])
4
                .set_by_hour(vec![1, 2, 3])
4
                .set_by_day(vec![OffsetWeekday::new(Weekday::Monday, None)])
4
                .set_by_month_day(vec![1, 2, 3])
4
                .set_by_year_day(vec![1, 2, 3])
4
                .set_by_week_number(vec![1, 2, 3])
4
                .set_by_month(vec![
4
                    time::Month::January,
4
                    time::Month::February,
4
                    time::Month::March,
4
                ])
4
                .set_by_set_pos(vec![1, 2, 3])
4
                .set_week_start(Weekday::Monday)
4
            })
4
            .add_iana_param("recurrence-rule-test", "test")
4
            .add_x_param("x-recurrence-rule-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.1.4
4
            .add_comment("test")
4
            .add_alternate_representation("http://example.com/test")
4
            .add_language(LanguageTag::new("en").with_region("US"))
4
            .add_iana_param("comment-test", "test")
4
            .add_x_param("x-comment-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.5.2
4
            .add_recurrence_date_date_times(vec![
4
                (
4
                    time::Date::from_calendar_date(2024, time::Month::August, 8).unwrap(),
4
                    Some(time::Time::from_hms(15, 0, 0).unwrap()),
4
                    true,
4
                )
4
                    .into(),
4
                (
4
                    time::Date::from_calendar_date(2024, time::Month::August, 9).unwrap(),
4
                    Some(time::Time::from_hms(15, 0, 0).unwrap()),
4
                    true,
4
                )
4
                    .into(),
4
            ])
4
            .add_tz_id("test", true)
4
            .add_iana_param("recurrence-date-test", "test")
4
            .add_x_param("x-recurrence-date-test", "test")
4
            .finish_property()
4
            .add_time_zone_name("test")
4
            .add_iana_param("time-zone-name-test", "test")
4
            .add_x_param("x-time-zone-name-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.8.1
4
            .add_iana_property("other", "some-value")
4
            .add_iana_param("other-test", "test")
4
            .add_x_param("x-other-test", "test")
4
            .finish_property()
4
            // RFC 5545: 3.8.8.2
4
            .add_x_property("x-other", "some-value")
4
            .add_iana_param("x-other-test", "test")
4
            .add_x_param("x-x-other-test", "test")
4
            .finish_property()
6
        })
4
        .finish_component()
6
        .add_iana_component("other-comp", |c| {
4
            c.add_iana_property("other", "some-value")
4
                .add_iana_param("other-test", "test")
4
                .add_x_param("x-other-test", "test")
4
                .finish_property()
4
                .add_x_property("x-other", "some-value")
4
                .add_iana_param("other-test", "test")
4
                .add_x_param("x-other-test", "test")
4
                .finish_property()
6
        })
6
        .add_x_component("x-other-comp", |c| {
4
            c.add_iana_property("other", "some-value")
4
                .add_iana_param("other-test", "test")
4
                .add_x_param("x-other-test", "test")
4
                .finish_property()
4
                .add_x_property("x-other", "some-value")
4
                .add_iana_param("other-test", "test")
4
                .add_x_param("x-other-test", "test")
4
                .finish_property()
6
        })
4
        .build()
4
}