public void XPPrompt_ShowDialog_WithParent_ShouldNotThrowError()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.ShowDialog(IntPtr.Zero);
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_Without_Target_ShouldThrowError()
        {
            XPPrompt prompt = new XPPrompt();

            Testing.ShouldThrowException <InvalidOperationException>(() => prompt.ShowDialog());
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_ShouldNotThrowError()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.ShowDialog();
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_IncorrectPassword()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.IncorrectPassword = true;
            prompt.ShowDialog(IntPtr.Zero);
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_UsernameReadOnly()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.UsernameReadOnly = true;
            prompt.ShowDialog(IntPtr.Zero);
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_ValidateUsername()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.ValidateUsername = true;
            prompt.ShowDialog(IntPtr.Zero);
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_RequreSmartCard()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.RequireSmartCard = true;
            prompt.ShowDialog(IntPtr.Zero);
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_ShowSaveCheckBox()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.ShowSaveCheckBox = true;
            prompt.ShowDialog(IntPtr.Zero);
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_RequestAdministrator()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.RequestAdministrator = true;
            prompt.ShowDialog(IntPtr.Zero);
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_RequreCertificate()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.RequireCertificate = true;
            prompt.ShowDialog(IntPtr.Zero);
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_GenericCredentials()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.GenericCredentials = true;
            prompt.ShowDialog(IntPtr.Zero).ShouldEqual(DialogResult.OK);
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_Persist()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.Persist = true;
            prompt.ShowDialog(IntPtr.Zero);
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_ExpectConfirmation()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.ExpectConfirmation = true;
            prompt.ShowDialog(IntPtr.Zero);
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_ExcludeCertificates()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.ExcludeCertificates = true;
            prompt.ShowDialog(IntPtr.Zero);
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_AlwaysShowUI_Without_GenericCredentials_ShouldThrowError()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.AlwaysShowUI = true;
            Testing.ShouldThrowException <InvalidOperationException>(() => prompt.ShowDialog(IntPtr.Zero));
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_AlwaysShowUI()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.AlwaysShowUI       = true;
            prompt.GenericCredentials = true;
            prompt.ShowDialog(IntPtr.Zero);
            prompt.Dispose();
        }
        public void XPPrompt_ShowDialog_With_Username()
        {
            XPPrompt prompt = GetDefaultPrompt();

            prompt.Username           = "******";
            prompt.Title              = "Enter enter valid credentials.";
            prompt.Message            = "Please enter valid credentials.";
            prompt.ShowSaveCheckBox   = true;
            prompt.GenericCredentials = true;
            prompt.ShowDialog().ShouldEqual(DialogResult.OK);
            prompt.Dispose();
        }
예제 #18
0
 public void XPPrompt_ShowDialog_Without_Target_ShouldThrowError()
 {
     XPPrompt prompt = new XPPrompt();
     Testing.ShouldThrowException<InvalidOperationException>(() => prompt.ShowDialog());
     prompt.Dispose();
 }