Feature/tasx 4 user domain class

Is it possible to write a unit test for a private method? Would it be
better to factor out a sha256sum function and test that? The User
constructor and the methods User.setPassword and User.passwordEquals call
User.hash, so would it suffice to test those? The desired behavior should
be independent of the actual hash function chosen.

On Wed, Oct 15, 2014 at 1:16 PM, Jose Cedeno <notifications@github.com>
wrote:

> In grails-app/domain/edu/oregonstate/mist/User.groovy:
>
> > +        return emailAddress;
> > +    }
> > +
> > +    public void setEmail(String email) {
> > +        emailAddress = email;
> > +    }
> > +
> > +    public void setPassword(String password) {
> > +        passwordHash = hash(password);
> > +    }
> > +
> > +    public Boolean passwordEquals(String password) {
> > +        return (hash(password) == passwordHash);
> > +    }
> > +
> > +    private String hash(String clearText) {
>
> Write some unit tests for your hash function
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/osu-mist/tasx/pull/1/files#r18919324>.
>