コード例 #1
0
        public async Task ShouldGetModelForValidInformation()
        {
            var getSessionsListQuery = new GetSessionsListQuery(tenantId: _tenantId, skip: 0, take: 10);

            var sessionsResponseModel = await _getSessionsListQueryHandler.Handle(getSessionsListQuery, CancellationToken.None);

            Assert.Null(sessionsResponseModel.Errors);
        }
コード例 #2
0
        public async Task ShouldItemsCount1WhenTake1()
        {
            var getSessionsListQuery = new GetSessionsListQuery(tenantId: _tenantId, skip: 0, take: 1);

            var sessionsResponseModel = await _getSessionsListQueryHandler.Handle(getSessionsListQuery, CancellationToken.None);

            Assert.Single(sessionsResponseModel.Items);
        }
コード例 #3
0
 public async Task <List <Domain.Entities.Session> > Handle(GetSessionsListQuery request, CancellationToken cancellationToken)
 {
     return(new List <Domain.Entities.Session>
     {
         new Domain.Entities.Session()
         {
             SessionId = 1,
             Title = "Angular State Management: Beyond NGRX",
             Description = "NGRX is a large opinionated library on how to do state management in Angular and is often marketed as ‘The Solution’ to all your state management woes. This talk is to tell you that NGRX isn’t the panacea to every ailment. On top of not curing my baldness NGRX is not always how to solve state management. There’s lots of other ways to deal with state management in Angular. This talk walks through the life of an Angular app and the appropriate state management tactics at different milestones. One size does not fit all. Of course, an internet bucket of hype has to be based on something, so we’ll finish with ‘when you need NGRX how to get started.",
             SignUps = 0,
             SpeakerId = 1
         }
     });
 }
コード例 #4
0
 public async Task <List <SessionListDto> > Handle(GetSessionsListQuery request, CancellationToken cancellationToken)
 {
     return(await _context.Sessions
            .ProjectTo <SessionListDto>(_mapper.ConfigurationProvider)
            .ToListAsync(cancellationToken));
 }