public void ThenThereMustBeSpecifiedTeamsWithTheSpecifiedScores() { Builder builder = new ConcreteBuilder(); Director director = new Director(builder); director.BuildFullFeaturedProduct(firstScore, secondScore); score = builder.GetScores(); Assert.IsTrue(GetPages <ScoresFixturesPage>().GetScore(firstTeam, secondTeam) == score); }
public Score GetScore(string team1, string team2) { score = scores.Where(x => x.FindElement(firstTeam).Text == team1 && x.FindElement(secondTeam).Text == team2).FirstOrDefault(); Builder builder = new ConcreteBuilder(); Director director = new Director(builder); director.BuildFullFeaturedProduct(Convert.ToByte(score.FindElement(firstTeamScore).Text), Convert.ToByte(score.FindElement(secondTeamScore).Text)); return(builder.GetScores()); }
public Score GetScore(string team1, string team2) { //if (team1 == firstTeam.Text && team2 == secondTeam.Text) //{ // return new Score { Score1 =Convert.ToByte(firstTeamScore.Text), Score2 = Convert.ToByte(secondTeamScore.Text) }; //} //return null; if (team1 == firstTeam.Text && team2 == secondTeam.Text) { Builder builder = new ConcreteBuilder(); Director director = new Director(builder); director.BuildFullFeaturedProduct(Convert.ToByte(firstTeamScore.Text), Convert.ToByte(secondTeamScore.Text)); return(builder.GetScores()); } return(null); }