public void DialogButtonCreateTest([Values( DialogButtonType.Ok, DialogButtonType.Cancel, DialogButtonType.Yes, DialogButtonType.No, DialogButtonType.Custom)] DialogButtonType type) { var dialogButton = DialogButton.Create(type); Assert.NotNull(dialogButton); Assert.AreEqual(type, dialogButton.Type); if (type != DialogButtonType.Custom) { Assert.AreEqual(type.ToString().ToUpperInvariant(), dialogButton.Caption.ToUpperInvariant()); } Assert.AreEqual(type == DialogButtonType.Ok || type == DialogButtonType.Yes || type == DialogButtonType.Custom, dialogButton.IsDefault); Assert.AreEqual(type == DialogButtonType.Cancel, dialogButton.IsCancel); }