void UserAlreadyExists()
        {
            var command = new CreatorCommand("Marcos", "holalola", "Marcos", "Bailon");

            Assert.Throws <InvalidUsernameException>(() => {
                handler.Trigger(command);
            });
        }
Ejemplo n.º 2
0
        private void BtnSaveAndNew_Click(object sender, EventArgs e)
        {
            Command = new CreatorCommand(txtUsername.Text, txtPassword.Text
                                         , txtFirstName.Text, txtLastName.Text);

            try
            {
                Create();

                CleanInputs();
            }
            catch (Exception saveAndNewUserException)
            {
                labelError.Text = saveAndNewUserException.Message;
            }
        }
Ejemplo n.º 3
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            Command = new CreatorCommand(txtUsername.Text, txtPassword.Text
                                         , txtFirstName.Text, txtLastName.Text);

            try
            {
                Create();

                this.Close();
            }
            catch (Exception saveUserException)
            {
                // Generic because it could be invalid user name or invalid user role
                labelError.Text = saveUserException.Message;
            }
        }
Ejemplo n.º 4
0
        public void ParametersFromSystemAndTypeTest(KnownSystem?knownSystem, MediaType?mediaType, CreatorCommand expected)
        {
            CreatorParameters actual = new CreatorParameters(knownSystem, mediaType, 'D', "disc.bin", 16, true, -1);

            Assert.Equal(expected, actual.Command);
        }
Ejemplo n.º 5
0
        public void BaseCommandToKnownSystemTest(CreatorCommand command, KnownSystem?expected)
        {
            KnownSystem?actual = Converters.ToKnownSystem(command);

            Assert.Equal(expected, actual);
        }
Ejemplo n.º 6
0
        public void BaseCommandToMediaTypeTest(CreatorCommand command, MediaType?expected)
        {
            MediaType?actual = command.ToMediaType();

            Assert.Equal(expected, actual);
        }