Пример #1
0
        public void Index()
        {
            SignUpController controller = new SignUpController(_userRepoMock.Object);
            ViewResult       result     = controller.Index();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.ViewName == "");
        }
        public void RegisterTest()
        {
            //Arrange
            Guid id      = new Guid("e54684cc-fe03-4388-8cbe-87eb6b019b56");
            var  usuario = new Usuario()
            {
                UsuarioId = id, Nome = "Ale", Senha = "1234567890", Email = "*****@*****.**", Token = "123", Telefones = new List <Telefone>(), DataUltimoLogin = DateTime.Now, DataAtualizacao = DateTime.Now, DataCriacao = DateTime.Now
            };

            _mockCriptografia.Setup(a => a.Hash(usuario.Senha)).Returns(It.IsAny <string>()).Verifiable();

            _mockUsuarioService.Setup(a => a.VerificarEmail(usuario.Email)).Returns(It.IsAny <bool>()).Verifiable();

            _mockUow.Setup(a => a.BeginTransaction()).Verifiable();

            //Act
            _signUpController.Index(usuario.Token, usuario.Nome, usuario.Email, usuario.Senha, It.IsAny <string>(), It.IsAny <List <Telefone> >());

            //Assert
            _repository.VerifyAll();
        }