public async Task ClubAdminsTest() { ClubService ClubService = CreateClubService(); var result = await ClubService.GetClubAdminsAsync(GetIdForSearch); Assert.NotNull(result); Assert.IsType <ClubProfileDTO>(result); }
public async Task GetClubAdminsAsync_ReturnsClubAdmins() { // Arrange ClubService clubService = CreateClubService(); // Act var result = await clubService.GetClubAdminsAsync(Id); // Assert Assert.NotNull(result); Assert.IsInstanceOf <ClubProfileDTO>(result); }
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); }
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>()); }