예제 #1
0
        public async Task Should_GetTotalAvailablePlaces()
        {
            // Arrange
            var LHandleTotalAvailablePlaces = new GetTotalAvailablePlacesQueryHandler(FMainDbContext);
            var LRequest = new GetTotalAvailablePlacesQuery();

            // Act
            var LResult = await LHandleTotalAvailablePlaces.Handle(LRequest, CancellationToken.None);

            // Assert
            LResult.Number.Should().Be(3);
        }
예제 #2
0
 public int Handle(GetTotalAvailablePlacesQuery _)
 {
     return(_dbContext.Set <ParkingPlace>()
            .Where(p => p.Parking.IsOpened && p.IsFree)
            .Count());
 }
예제 #3
0
        public int GetTotalAvailablePlaces()
        {
            var query = new GetTotalAvailablePlacesQuery();

            return(_queryHandler.Handle(query));
        }