예제 #1
0
        public void DialogButtonCreateCustomTest(
            [Values("Caption 1", "Caption 2")] string caption)
        {
            var dialogButton = DialogButton.Create(DialogButtonType.Custom, caption);

            Assert.AreEqual(DialogButtonType.Custom, dialogButton.Type);
            Assert.AreEqual(caption, dialogButton.Caption);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public void DialogButtonCreateThrowsTest()
 {
     Assert.Throws <ArgumentException>(() => DialogButton.Create(DialogButtonType.Unknown));
 }