11using Microsoft . VisualStudio . TestTools . UnitTesting ;
22using Box . Sdk . Gen . Internal ;
3+ using System ;
4+ using System . Collections . ObjectModel ;
5+ using System . Collections . Generic ;
36using Box . Sdk . Gen ;
47using Box . Sdk . Gen . Schemas ;
58using Box . Sdk . Gen . Managers ;
@@ -21,6 +24,28 @@ public async System.Threading.Tasks.Task TestEvents() {
2124 Assert . IsTrue ( StringUtils . ToStringRepresentation ( NullableUtils . Unwrap ( firstEvent . EventType ) ) != "" ) ;
2225 }
2326
27+ [ TestMethod ]
28+ public async System . Threading . Tasks . Task TestEventUpload ( ) {
29+ Events events = await client . Events . GetEventsAsync ( queryParams : new GetEventsQueryParams ( ) { StreamType = GetEventsQueryParamsStreamTypeField . AdminLogs , EventType = Array . AsReadOnly ( new [ ] { new StringEnum < GetEventsQueryParamsEventTypeField > ( GetEventsQueryParamsEventTypeField . Upload ) } ) } ) ;
30+ Assert . IsTrue ( NullableUtils . Unwrap ( events . Entries ) . Count > 0 ) ;
31+ Event firstEvent = NullableUtils . Unwrap ( events . Entries ) [ 0 ] ;
32+ Assert . IsTrue ( StringUtils . ToStringRepresentation ( NullableUtils . Unwrap ( firstEvent . EventType ) ) == "UPLOAD" ) ;
33+ }
34+
35+ [ TestMethod ]
36+ public async System . Threading . Tasks . Task TestEventDeleteUser ( ) {
37+ Events events = await client . Events . GetEventsAsync ( queryParams : new GetEventsQueryParams ( ) { StreamType = GetEventsQueryParamsStreamTypeField . AdminLogs , EventType = Array . AsReadOnly ( new [ ] { new StringEnum < GetEventsQueryParamsEventTypeField > ( GetEventsQueryParamsEventTypeField . DeleteUser ) } ) } ) ;
38+ Assert . IsTrue ( NullableUtils . Unwrap ( events . Entries ) . Count > 0 ) ;
39+ Event firstEvent = NullableUtils . Unwrap ( events . Entries ) [ 0 ] ;
40+ Assert . IsTrue ( StringUtils . ToStringRepresentation ( NullableUtils . Unwrap ( firstEvent . EventType ) ) == "DELETE_USER" ) ;
41+ }
42+
43+ [ TestMethod ]
44+ public async System . Threading . Tasks . Task TestEventSourceFileOrFolder ( ) {
45+ Events events = await client . Events . GetEventsAsync ( queryParams : new GetEventsQueryParams ( ) { StreamType = GetEventsQueryParamsStreamTypeField . Changes } ) ;
46+ Assert . IsTrue ( NullableUtils . Unwrap ( events . Entries ) . Count > 0 ) ;
47+ }
48+
2449 [ TestMethod ]
2550 public async System . Threading . Tasks . Task TestGetEventsWithLongPolling ( ) {
2651 RealtimeServers servers = await client . Events . GetEventsWithLongPollingAsync ( ) ;
0 commit comments