public async Task GetTeamSeason_WhenExceptionIsCaught_ShouldReturnInternalServerError()
        {
            // Arrange
            var        teamSeasonRepository = A.Fake <ITeamSeasonRepository>();
            TeamSeason?teamSeason           = new TeamSeason();

            A.CallTo(() => teamSeasonRepository.GetTeamSeasonAsync(A <int> .Ignored)).Throws <Exception>();

            var sharedRepository = A.Fake <ISharedRepository>();

            var             mapper          = A.Fake <IMapper>();
            TeamSeasonModel?teamSeasonModel = new TeamSeasonModel();

            A.CallTo(() => mapper.Map <TeamSeasonModel>(A <TeamSeason> .Ignored)).Returns(teamSeasonModel);

            var linkGenerator = A.Fake <LinkGenerator>();

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

            int id = 1;

            // Act
            var result = await testController.GetTeamSeason(id);

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

            A.CallTo(() => teamSeasonRepository.GetTeamSeasonAsync(A <int> .Ignored)).Returns(teamSeason);

            var sharedRepository = A.Fake <ISharedRepository>();

            var             mapper          = A.Fake <IMapper>();
            TeamSeasonModel?teamSeasonModel = new TeamSeasonModel();

            A.CallTo(() => mapper.Map <TeamSeasonModel>(A <TeamSeason> .Ignored)).Returns(teamSeasonModel);

            var linkGenerator = A.Fake <LinkGenerator>();

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

            int id = 1;

            // Act
            var result = await testController.GetTeamSeason(id);

            // Assert
            A.CallTo(() => teamSeasonRepository.GetTeamSeasonAsync(id)).MustHaveHappenedOnceExactly();
            A.CallTo(() => mapper.Map <TeamSeasonModel>(teamSeason)).MustHaveHappenedOnceExactly();
            result.Value.ShouldBeOfType <TeamSeasonModel>();
        }