Ejemplo n.º 1
0
        public async Task ClubAdminsTest()
        {
            ClubService ClubService = CreateClubService();

            var result = await ClubService.GetClubAdminsAsync(GetIdForSearch);

            Assert.NotNull(result);
            Assert.IsType <ClubProfileDTO>(result);
        }
Ejemplo n.º 2
0
        public async Task GetClubAdminsAsync_ReturnsClubAdmins()
        {
            // Arrange
            ClubService clubService = CreateClubService();

            // Act
            var result = await clubService.GetClubAdminsAsync(Id);

            // Assert
            Assert.NotNull(result);
            Assert.IsInstanceOf <ClubProfileDTO>(result);
        }
Ejemplo n.º 3
0
        public async Task GetClubAdminsAsync_WithClubIsNull_ReturnsNull()
        {
            // Arrange
            ClubService clubService = CreateClubService();

            _mapper.Setup(m => m.Map <DataAccessClub.Club, ClubDTO>(It.IsAny <DataAccessClub.Club>()))
            .Returns((ClubDTO)null);

            // Act
            var result = await clubService.GetClubAdminsAsync(Id);

            // Assert
            Assert.Null(result);
        }
Ejemplo n.º 4
0
        public async Task GetClubAdminsAsync_WhereHeadIsNull_ReturnClubProfile()
        {
            // Arrange
            ClubService clubService = CreateClubService();

            _mapper.Setup(m => m.Map <DataAccessClub.Club, ClubDTO>(It.IsAny <DataAccessClub.Club>()))
            .Returns(CreateFakeClubDtoWithExAdmin(count).FirstOrDefault());

            // Act
            var result = await clubService.GetClubAdminsAsync(Id);

            // Assert
            Assert.NotNull(result);
            Assert.Null(result.Head);
            Assert.AreEqual(result.Admins, new List <ClubAdministrationDTO>());
        }