public void GivenAValidInput_UserIsCreated()
        {
            var pipe = new DataPipeFake(new List <string> {
                _username, _name, _password, _confirmedPassword
            });
            var validator = new PasswordValidator();

            _expected.Add("Saving Details for User (username, user name, drowssap)\n");
            var cypher = new Cypher();

            var sm = new SecurityManager(pipe, validator, cypher);

            sm.CreateUser();

            DoAssertions(pipe.Outputs, _expected);
        }
        public void GivenAnInvalidPasswordInput_UserIsNotCreated()
        {
            var shortPwd = "pass";
            var pipe     = new DataPipeFake(new List <string> {
                _username, _name, shortPwd, shortPwd
            });
            var validator = new PasswordValidator();

            _expected.Add("Password must be at least 8 characters in length");
            var cypher = new Cypher();

            var sm = new SecurityManager(pipe, validator, cypher);

            sm.CreateUser();

            DoAssertions(pipe.Outputs, _expected);
        }
        public void GivenAnUnconfirmedPasswordInput_UserIsNotCreated()
        {
            var wrong = "wrongpassword";
            var pipe  = new DataPipeFake(new List <string> {
                _username, _name, _password, wrong
            });
            var validator = new PasswordValidator();

            _expected.Add("The passwords don't match");
            var cypher = new Cypher();

            var sm = new SecurityManager(pipe, validator, cypher);

            sm.CreateUser();

            DoAssertions(pipe.Outputs, _expected);
        }