コード例 #1
0
        public async Task GetClubsListAsync()
        {
            // Act
            PagedResultDto<ClubPlayerListDto> result = await _playersAppService.GetClubsListAsync(
                Guid.Parse("85ea0ccf-0fad-4c6f-b660-23e6004a777d"),
                new GetClubPlayersInput());

            // Assert
            result.TotalCount.ShouldBe(2);
            result.Items.Count.ShouldBe(2);
            result.Items.Any(x => x.Id == Guid.Parse("d6f4c147-22a2-475b-80bb-bacf18d08ce2")).ShouldBe(true);
            result.Items.Any(x => x.Id == Guid.Parse("2bbaae46-29fe-4b1c-99f8-63a9296204cf")).ShouldBe(true);

            ClubPlayerListDto clubPlayerListDto = result.Items.First(x => x.Id == Guid.Parse("d6f4c147-22a2-475b-80bb-bacf18d08ce2"));
            clubPlayerListDto.Id.ShouldBe(Guid.Parse("d6f4c147-22a2-475b-80bb-bacf18d08ce2"));
            clubPlayerListDto.Club.Id.ShouldBe(Guid.Parse("d772238a-9871-47d7-84d5-c45083799954"));
            clubPlayerListDto.Club.Name.ShouldBe("Snooker Club 1");
            clubPlayerListDto.IsPrimaryClubOfPlayer.ShouldBeTrue();
        }
コード例 #2
0
        public async Task GetPlayersListAsync()
        {
            // Act
            PagedResultDto <ClubPlayerListDto> result = await _clubsAppService.GetPlayersListAsync(
                Guid.Parse("d772238a-9871-47d7-84d5-c45083799954"),
                new GetClubPlayersInput());

            // Assert
            result.TotalCount.ShouldBe(2);
            result.Items.Count.ShouldBe(2);
            result.Items.Any(x => x.Id == Guid.Parse("d6f4c147-22a2-475b-80bb-bacf18d08ce2")).ShouldBe(true);
            result.Items.Any(x => x.Id == Guid.Parse("7278ac73-6d82-459b-9289-aa760dcb2722")).ShouldBe(true);

            ClubPlayerListDto clubPlayerListDto = result.Items.FirstOrDefault(x => x.Id == Guid.Parse("d6f4c147-22a2-475b-80bb-bacf18d08ce2"));

            clubPlayerListDto.Id.ShouldBe(Guid.Parse("d6f4c147-22a2-475b-80bb-bacf18d08ce2"));
            clubPlayerListDto.Player.Id.ShouldBe(Guid.Parse("85ea0ccf-0fad-4c6f-b660-23e6004a777d"));
            clubPlayerListDto.Player.FirstName.ShouldBe("John");
            clubPlayerListDto.Player.LastName.ShouldBe("Doe");
            clubPlayerListDto.IsPrimaryClubOfPlayer.ShouldBe(true);
        }