Esempio n. 1
0
        public void DeveLancarErroNoCatcher()
        {
            Validacao.Erros.Clear();

            AutenticacaoController buggyController = new AutenticacaoController(new FakeBuggyFormsAuthenticationService());

            ControllerContextMock.SetupNormalContext(buggyController);

            Assert.AreEqual(0, Validacao.Erros.Count);

            var result = buggyController.LogOn("antonio", "123456", null, null, null, null) as ViewResult;

            Assert.AreEqual(1, Validacao.Erros.Count);
            Assert.IsInstanceOfType(result.Model, typeof(LogonVM));

            Validacao.Erros.Clear();
        }
Esempio n. 2
0
        private void assertChangePassLoginBehavior(String login, String senha)
        {
            var result = testController.LogOn(login, senha, null, null, null, null) as ViewResult;

            Assert.IsNull(HttpContext.Current.User);
        }