public Rectangle(double height, double width) { SimpleValidator.CheckNotPositive((decimal)height, "height"); SimpleValidator.CheckNotPositive((decimal)width, "width"); this.Height = height; this.Width = width; }
public Square(double height, double width) { SimpleValidator.CheckNotPositive((decimal)height, "height"); SimpleValidator.CheckNotPositive((decimal)width, "width"); if (Math.Abs(height - width) > 0.001) { throw new ArgumentException("The sides of a square must be equal"); } Height = height; Width = width; }