/// <summary> /// Initializes a new instance of the <see cref="Apple" /> class with the specified quality. /// </summary> /// <param name="color">The colour of this <see cref="Apple"/>.</param> /// <param name="quality">The quality of this <see cref="Apple"/>.</param> /// <exception cref="ArgumentOutOfRangeException"><paramref name="color"/> specified an /// invalid value.</exception> public Apple(AppleColor color, int quality) : base(quality) { switch (color) { case AppleColor.Red: this.Color = "Red"; break; case AppleColor.Green: this.Color = "Green"; break; default: throw new ArgumentOutOfRangeException(nameof(color)); } }
public bool Equals(AppleColor other) { return string.Equals(PrimaryColor, other.PrimaryColor) && string.Equals(SecondaryColor, other.SecondaryColor); }