Package br.com.six2six.template

Source Code of br.com.six2six.template.UserTemplate

package br.com.six2six.template;

import br.com.six2six.bfgex.Gender;
import br.com.six2six.fixturefactory.Fixture;
import br.com.six2six.fixturefactory.Rule;
import br.com.six2six.fixturefactory.loader.TemplateLoader;
import br.com.six2six.fixturefactory.model.User;

public class UserTemplate implements TemplateLoader {

  @Override
  public void load() {
    Fixture.of(User.class).addTemplate("anyValidUser", new Rule(){{
      add("name", name());
      add("login", random("login1", "login2"));
      add("password", "madona");
      add("gender", random(Gender.class));
      add("email", "${login}@gmail.com");
    }}
    ).addTemplate("validFemaleUser", new Rule(){{
      add("name", name(Gender.FEMALE));
      add("login", "${name}");
      add("password", name(Gender.MALE));
      add("gender", Gender.FEMALE);
      add("email", "duck@gmail.com");
    }});
  }
}
TOP

Related Classes of br.com.six2six.template.UserTemplate

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.