Package br.com.six2six.template

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

package br.com.six2six.template;

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.City;
import br.com.six2six.fixturefactory.model.Neighborhood;
import br.com.six2six.fixturefactory.model.Route;
import br.com.six2six.fixturefactory.model.RouteId;

public class RouteTemplate implements TemplateLoader {

  @Override
  public void load() {
    Fixture.of(Route.class).addTemplate("routeWithDifferentCities", new Rule() {{
      add("id", one(RouteId.class, "valid"));
        add("cities", has(2).of(City.class, "saoPaulo", "rioDeJaneiro"));
    }});
   
    Fixture.of(City.class).addTemplate("saoPaulo", new Rule() {{
          add("name", "São Paulo");
          add("neighborhoods", has(2).of(Neighborhood.class, "valid"));
      }}).addTemplate("rioDeJaneiro", new Rule() {{
        add("name", "Rio de Janeiro");
          add("neighborhoods", has(2).of(Neighborhood.class, "valid"));
      }});
  }
 
}
TOP

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

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.