public PlayerScorePredictor(ITeamStrengthCalculator teamStrengthCalculator, IPredictorParameters predictorParameters, IPlayerFormCalculator playerFormCalculator) { _teamStrengthCalculator = teamStrengthCalculator; _predictorParameters = predictorParameters; _playerFormCalculator = playerFormCalculator; PrimeCache(); }
public void SetUp() { _allPlayers = new List<Player>(); _player = new Player { PastSeasons = new List<Season>(), PastFixtures = new List<PastFixture>() }; _configSettingsMock = new Mock<IConfigurationSettings>(); _configSettingsMock.Setup(x => x.SeasonStartYear).Returns(2012); _predictorParametersMock = new Mock<IPredictorParameters>(); _predictorParametersMock.SetupGet(x => x.HomeAdvantageMultiplier).Returns(1.0); _predictorParametersMock.SetupGet(x => x.AwayAdvantageMultiplier).Returns(1.0); _predictorParametersMock.SetupGet(x => x.PastGamesUsedToCalculatePlayerForm).Returns(5); _predictorParametersMock.SetupGet(x => x.PreviousGameMultiplier).Returns(1.0); _teamStrengthCalculatorMock = new Mock<ITeamStrengthCalculator>(); _teamStrengthCalculatorMock.Setup( x => x.CalculateTeamStrength(It.IsAny<string>(), It.IsAny<IList<Player>>())).Returns(new TeamStrength { TeamStrengthMultiplier = 1.0 }); _playerFormCalculator = new PlayerFormCalculator(_predictorParametersMock.Object, _teamStrengthCalculatorMock.Object, _configSettingsMock.Object); }