public void VisitBootstrapAction()
        {
            //Init args
            BootstrapAction bootstrapAction = new BootstrapAction();

            bootstrapAction.Name = "bootstrap-role:{myRole}";
            bootstrapAction.Path = "{myBucket}/lala.sh";
            bootstrapAction.Args = new List <string> {
                "{arg1}", "900"
            };

            //Expectations
            List <string> expectedArgs = new List <string>()
            {
                "1234", "900"
            };

            //Init visitor
            BuildRequestVisitor visitor           = new BuildRequestVisitor(BuildRequestVisitorTest.GetSettings());
            VisitorSubscriber   visitorSubscriber = new VisitorSubscriber(visitor);

            //Action
            bootstrapAction.Accept(visitor);

            //Verify
            Assert.AreEqual(1, visitorSubscriber.TotalObjCount, "Unexpected number of objects created");

            BootstrapActionConfig actual = visitorSubscriber.bootstrapActionList[0];

            Assert.AreEqual("bootstrap-role:SupperSlonic", actual.Name, "Unexpected Name");
            Assert.AreEqual("s3://myBucket/lala.sh", actual.ScriptBootstrapAction.Path, "Unexpected ScriptBootstrapAction.Path");
            Assert.IsTrue(expectedArgs.SequenceEqual(actual.ScriptBootstrapAction.Args), "Unexpected args list");
        }
        public void BootstrapactionNameIsMissing()
        {
            //Input
            BootstrapAction bootstrapAction = new BootstrapAction();

            //Init visitor
            BuildRequestVisitor visitor           = new BuildRequestVisitor(BuildRequestVisitorTest.GetSettings());
            VisitorSubscriber   visitorSubscriber = new VisitorSubscriber(visitor);

            //Action
            try
            {
                bootstrapAction.Accept(visitor);
                Assert.Fail("Exception has not been thrown!!!");
            }
            catch (InvalidOperationException ex)
            {
                Assert.IsFalse(visitorSubscriber.wasAnyEventFired, "None of the visitor's events should be fired!");
                Assert.AreEqual <string>("Name property is missing for the BootstrapAction. Example: \"upload libs\"", ex.Message, "Unexpected exception message");
            }
        }