public Player( string firstName, string lastName, int age, string nationality, string photoUrl, BattingStyle battingStyle, BowlingStyle bowlingStyle, FieldingPosition fieldingPosition, History history) { this.Validate(firstName, lastName, age, nationality, photoUrl); this.ValidateBowlingStyle(bowlingStyle); this.ValidateFieldingPosition(fieldingPosition); this.FirstName = firstName; this.LastName = lastName; this.Age = age; this.Nationality = nationality; this.PhotoUrl = photoUrl; this.BattingStyle = battingStyle; this.BowlingStyle = bowlingStyle; this.FieldingPosition = fieldingPosition; this.History = history; }
public void UpdateBowlingStyleShouldSetBowlingStyle() { //Arrange var bowlingStyle = A.Dummy <BowlingStyle>(); //Act this._player !.UpdateBowlingStyle(bowlingStyle); //Assert this._player !.BowlingStyle .Should() .BeEquivalentTo(bowlingStyle); }
public void InvalidBowlingStyleNameShouldThrowException() { //Arrange var bowlingStyle = new BowlingStyle( "Invalid bowling", BowlingTypes.FastBowling, "Some invalid bowling style"); //Act Action act = () => this._player !.UpdateBowlingStyle(bowlingStyle); //Assert act.Should().Throw <InvalidPlayerException>(); }