protected virtual void PrintEvent(BoxEnterpriseEvent evt) { Reporter.WriteInformation($"***********************"); Reporter.WriteInformation($"Event ID: {evt.EventId}"); Reporter.WriteInformation($"Event Type: {evt.EventType}"); Reporter.WriteInformation($"Session ID: {evt.SessionId}"); Reporter.WriteInformation($"Source ID: {evt.Source.Id}"); Reporter.WriteInformation($"Source Type: {evt.Source.Type}"); base.PrintMiniUser(evt.CreatedBy); Reporter.WriteInformation($"***********************"); }
public async Task EnterpriseEventsStreamingAsync_ForNewFile_ShouldReturnUploadFileEvent() { var uploadedFile = await CreateSmallFile(FolderId); await Retry(async() => { var events = await AdminClient.EventsManager.EnterpriseEventsStreamingAsync(); BoxEnterpriseEvent uploadedFileEvent = null; while (events.ChunkSize == 500 || uploadedFileEvent == null) { events = await AdminClient.EventsManager.EnterpriseEventsStreamingAsync(500, events.NextStreamPosition, new List <string>() { "UPLOAD" }); uploadedFileEvent = events.Entries.FirstOrDefault(x => x.Source?.Id == uploadedFile.Id); } Assert.IsNotNull(uploadedFileEvent); Assert.AreEqual("UPLOAD", uploadedFileEvent.EventType); Assert.AreEqual(uploadedFile.Id, uploadedFileEvent.Source.Id); Assert.AreEqual("file", uploadedFileEvent.Source.Type); }); }