Exemplo n.º 1
0
        public void InvalidUsername()
        {
            AuthenticateUserCommand command = new AuthenticateUserCommand("Jose", "123");

            Assert.Throws <InvalidAuthUsernameExeption>(
                () =>
            {
                handler.Trigger(command);
            }
                );
        }
Exemplo n.º 2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                Command = new AuthenticateUserCommand(txtUsername.Text, txtPassword.Text);
                Handler.Trigger(Command);

                var dictionary = Routes.GetRoutes();
                var controller = (IController)dictionary["CreateUser"];
                var form       = controller.Show();
                this.Hide();

                form.Show();
            }
            catch (Exception AuthExeption)
            {
                labelError.Text = AuthExeption.Message;
            }
        }