Ejemplo n.º 1
0
        public void SetUp()
        {
            var writer = new DeploymentWriter("starwars");

            var recipeDefinition = writer.RecipeFor("r1");
            var host             = recipeDefinition.HostFor("h1");

            host.AddDirective(new SimpleSettings
            {
                One = "one",
                Two = "two"
            });

            host.AddDirective(new OneSettings()
            {
                Name = "Jeremy",
                Age  = 37
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle1"
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle2"
            });

            recipeDefinition.HostFor("h2").AddProperty <ThreeSettings>(x => x.Direction, "North");
            recipeDefinition.HostFor("h3").AddProperty <TwoSettings>(x => x.City, "Austin");


            writer.RecipeFor("r2").HostFor("h3").AddProperty <SimpleSettings>(x => x.One, "one");
            writer.RecipeFor("r3").HostFor("h3").AddProperty <SimpleSettings>(x => x.Two, "two");
            writer.RecipeFor("r4").HostFor("h4").AddProperty <SimpleSettings>(x => x.Two, "ten");
            writer.RecipeFor("r4").HostFor("h5").AddProperty <SimpleSettings>(x => x.Two, "ten");
            writer.RecipeFor("r4").HostFor("h5").AddProperty <SimpleSettings>(x => x.One, "setting is {setting}");


            writer.Flush(FlushOptions.Wipeout);

            var environmentSettings = new EnvironmentSettings();

            environmentSettings.Overrides["setting"] = "environment setting";

            theRecipes = RecipeReader.ReadRecipes("starwars\\recipes", environmentSettings);
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            var writer = new DeploymentWriter("profile3");

            var recipeDefinition = writer.RecipeFor("r1");

            recipeDefinition.RegisterDependency("the-pig");
            recipeDefinition.RegisterDependency("freestate");

            var host = recipeDefinition.HostFor("h1");

            host.AddDirective(new SimpleSettings
            {
                One = "one",
                Two = "two"
            });

            host.AddDirective(new OneSettings()
            {
                Name = "Jeremy",
                Age  = 37
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle1"
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle2"
            });

            recipeDefinition.HostFor("h2").AddProperty <ThreeSettings>(x => x.Direction, "North");
            recipeDefinition.HostFor("h3").AddProperty <TwoSettings>(x => x.City, "Austin");


            writer.Flush(FlushOptions.Wipeout);


            theRecipe = RecipeReader.ReadFrom("profile3/recipes/r1", new EnvironmentSettings());
        }
 public TrueBlood()
     : base()
 {
     RecipeReader.InitTrueBloodInstance(this);
 }