public void SetBoundaries(IEnumerable<IBoundary> newBoundaries)
{
var newBoundariesList = newBoundaries as List<IBoundary> ?? newBoundaries.ToList();
if (newBoundariesList.Select(b => b.Grade).Distinct().Count() != newBoundariesList.Count)
{
throw new ArgumentException("Boundary grades must be unique.", "newBoundaries");
}
if (newBoundariesList.Select(b => b.MinResult).Distinct().Count() != newBoundariesList.Count)
{
throw new ArgumentException("Boundary min results must be unique.", "newBoundaries");
}
this.boundaries = newBoundariesList.ToDictionary(b => b.Grade);
}