public async Task GetTeamSeasons_WhenExceptionIsCaught_ShouldReturnInternalServerError()
        {
            // Arrange
            var teamSeasonRepository = A.Fake <ITeamSeasonRepository>();

            A.CallTo(() => teamSeasonRepository.GetTeamSeasonsAsync()).Throws <Exception>();

            var sharedRepository = A.Fake <ISharedRepository>();
            var mapper           = A.Fake <IMapper>();
            var linkGenerator    = A.Fake <LinkGenerator>();

            var testController = new TeamSeasonsController(teamSeasonRepository, sharedRepository, mapper,
                                                           linkGenerator);

            // Act
            var result = await testController.GetTeamSeasons();

            // Assert
            result.Result.ShouldBeOfType <ObjectResult>();
            ((ObjectResult)result.Result).StatusCode.ShouldBe(StatusCodes.Status500InternalServerError);
            ((ObjectResult)result.Result).Value.ShouldBe("Database failure");
        }
        public async Task GetTeamSeasons_WhenNoExceptionIsCaught_ShouldGetTeamSeasons()
        {
            // Arrange
            var teamSeasonRepository = A.Fake <ITeamSeasonRepository>();
            var teamSeasons          = new List <TeamSeason>();

            A.CallTo(() => teamSeasonRepository.GetTeamSeasonsAsync()).Returns(teamSeasons);

            var sharedRepository = A.Fake <ISharedRepository>();
            var mapper           = A.Fake <IMapper>();
            var linkGenerator    = A.Fake <LinkGenerator>();

            var testController = new TeamSeasonsController(teamSeasonRepository, sharedRepository, mapper, linkGenerator);

            // Act
            var result = await testController.GetTeamSeasons();

            // Assert
            A.CallTo(() => teamSeasonRepository.GetTeamSeasonsAsync()).MustHaveHappenedOnceExactly();
            A.CallTo(() => mapper.Map <TeamSeasonModel[]>(teamSeasons)).MustHaveHappenedOnceExactly();
            result.ShouldBeOfType <ActionResult <TeamSeasonModel[]> >();
            result.Value.ShouldBe(mapper.Map <TeamSeasonModel[]>(teamSeasons));
        }