Example #1
0
        public void CreateUserCommandWithLettersInPhoneShouldFail()
        {
            var command = new CreateUserCommand();

            command.Email       = "*****@*****.**";
            command.Login       = "******";
            command.MobilePhone = "9988887777";
            command.Name        = "teste";
            command.Password    = "******";
            command.Phone       = "776666b5555";

            var validator = ContainerExtensions.GetInstance <IValidator>();
            var errors    = validator.Validate(command);

            Assert.AreEqual(1, errors.Count());
        }
Example #2
0
        public void ValidCreateUserCommandShouldSucceed()
        {
            var command = new CreateUserCommand();

            command.Email       = "*****@*****.**";
            command.Login       = "******";
            command.MobilePhone = "+ 55888 7777";
            command.Name        = "teste";
            command.Password    = "******";
            command.Phone       = "+5588 8877 77";

            var validator = ContainerExtensions.GetInstance <IValidator>();
            var errors    = validator.Validate(command);

            Assert.AreEqual(0, errors.Count());
        }