public RoundService(IRoundRepository roundRepo, IMatchRepository matchRepo) { _roundRepo = roundRepo; _matchRepo = matchRepo; _roundVali = new RoundValidator(); }
public override ValidationResult Validate() { var roundValidator = new RoundValidator(); var validationResult = roundValidator.Validate(this); SetValidationResult(validationResult); return(validationResult); }
public void TestExceptionThrownWhenRoundNumberIsLessThanOne(int roundNumber) { RoundValidator rv = new RoundValidator(); var round = new Round { RoundNumber = roundNumber }; Assert.Throws <InvalidDataException>(() => rv.ValidateRound(round)); }
public Round Create(double x, double y, double radius, out IEnumerable <ValidationFailure> listError) { var validator = new RoundValidator(); var tempRound = new Round(x, y, radius); var result = validator.Validate(tempRound); if (result.IsValid == false) { listError = result.Errors; return(null); } listError = new List <ValidationFailure>(); return(tempRound); }