protected override async Task OnInitializedAsync()
 {
     try
     {
         IsLoading = true;
         this.MyPendingVideosQueue = await VideoClientService.GetMyPendingVideosQueueAsync();
     }
     catch (Exception ex)
     {
         this.ToastifyService.DisplayErrorNotification(ex.Message);
     }
     finally
     {
         IsLoading = false;
     }
 }
Exemple #2
0
        public async Task GetMyPendingVideosQueueTest()
        {
            var authorizedHttpClient = await base.SignIn(Role.User);

            VideoClientService videoClientService = base.CreateVideoClientService();
            var dbContext = TestsBase.CreateDbContext();
            var videos    = await dbContext.VideoInfo.ToListAsync();

            var userEntity = await dbContext.ApplicationUser.Where(p => p.AzureAdB2cobjectId.ToString() ==
                                                                   TestsBase.TestAzureAdB2CAuthConfiguration !.AzureAdUserObjectId).SingleAsync();

            var testVideoEntity = CreateTestVideoEntity();

            testVideoEntity.VideoIndexStatusId = (short)Common.Global.Enums.VideoIndexStatus.Pending;
            testVideoEntity.ApplicationUserId  = userEntity.ApplicationUserId;
            await dbContext.VideoInfo.AddAsync(testVideoEntity);

            await dbContext.SaveChangesAsync();

            var result = await videoClientService.GetMyPendingVideosQueueAsync();

            Assert.AreEqual(1, result.Count);
        }